You can use a interval based solution instead of using a while loop like console.log('START LOOP MY FUNCTION'); //start the function loop(function () { //this callback will be called once `a` becomes 1 console.log('EXIT LOOP MY FUNCTION'); }) function loop(callback) { var a = 1, timer; //to run myFunction every...
This occurs because the HTML5 parser Lift uses converts all tag and attribute names to lowercase. It is recommended to use either: class="lift:Snippet" or data-lift="Snippet" to avoid that. This was not an issue with the older XHTML parser as that was case sensitive, so you will find some older documentation...
c#,.net,visual-studio,visual-studio-2013,code-snippets
I see your problem now. If you add your snippet inside of the class this will work. If you insert this outside of your class on the top this can't work because the class is not the context of the snippet.
<snippet> <content><![CDATA[ (function (\$) { var defaults = {}; function ${1:name}(${2:element}, ${3:options}) { this.config = \$.extend({}, ${2:defaults}, ${3:options}); this.element = element; this.init(); } ${1:NAME}.prototype.init = function () { }; \$.fn.${1:name} = function (options) { new ${1:NAME}(this.first(), options); return this.first(); }; }(jQuery)); ]]></content> <tabTrigger>jqp</tabTrigger> <scope>source.js</scope> </snippet> This should do the trick....
when block is highlighted just press Return key
php,wordpress,wordpress-plugin,code-snippets,magic-quotes
You don't need to use add_magic_quotes. From the wp_insert_post documentation: This function inserts posts (and pages) in the database. It sanitizes variables, does some checks, fills in missing variables like date/time, etc Emphasis is mine. https://codex.wordpress.org/Function_Reference/wp_insert_post add_magic_quotes essentially iterates over an array and calls add_slashes on each element. This is...
code-snippets,modx-revolution,chunks
if (isset($_POST["value"])) { // here first time checking $var = (int) $_POST["value"]; // (int) is for security purpose // all other your code here ... } ...
android,reference,code-snippets,guide
Here are some PDFs you may be interested in: http://www.cs.virginia.edu/~cs201/labs/Vogella-Android-Development-Tutorial.pdf http://pl.cs.jhu.edu/oose/resources/android/Android-Tutorial.pdf http://www.cse.nd.edu/~cpoellab/teaching/cse40816/android_tutorial.pdf http://www.stanford.edu/class/ee368/Android/Tutorial-1-Basic-Android-Setup-Linux.pdf Further I recommend watching videos instead. Check out over here in these you could find many series teaching you what you want I believe that thenewboston and leveluptuts are good choices...
c-j is a very common mapping and could be used by other plugin / or tmux, Try to change the mapping to c-e
javascript,ruby-on-rails,ckeditor,code-snippets
I wasn't able to get this to work at all using any ckeditor gems. As a result, I completely removed the ck_editor rails gem and downloaded a build directly from the ckeditor website with the plugins I wanted added in. I then placed the whole ckeditors folder into my app...
sublimetext,code-snippets,sublimetext3
You can specify the position of the cursor using $0, example: <snippet> <content><![CDATA[ <ul>$0</ul> ]]></content> <tabTrigger>ul</tabTrigger> <scope>text.html</scope> </snippet> I recommend taking a look at the excellent Emmet plugin, as it makes scaffolding of nested HTML tags pretty easy....
Judging by the blog post, there is no 'usefulness' except syntactic sugar, turning: slice.call([1,2,3], 0, 1); slice.apply([1,2,3], [0,1]); to slice([1,2,3], 0, 1); The change allows to pass proper this context as the first argument of the function without explicitly calling call and apply....
regex,sublimetext2,code-snippets
Instead of doing a simple replacement, you need a format string to your regex, as discussed in the snippets reference. So, your snippet should look like this: <snippet> <content><![CDATA[ get${1:User} ('$2', function(err, ${1/(.*)/\L\1\E/i}){$0}); ]]></content> <!-- Optional: Set a tabTrigger to define how to trigger the snippet --> <tabTrigger>get</tabTrigger> <!-- Optional:...
visual-studio-2012,code-snippets
When you select a snippet in Code Snippets Manager, the Location is listed in the text box above the list. You can select that location, and paste it into an Explorer Address bar and open the file location of the snippet. Just delete the offending snippet and you'll never see...
google-analytics,code-snippets,google-tag-manager
There are a few paid services that I can think of: Observepoint Tag Inspector I'm sure there are others, but those are the ones I've used. You can also use GTM's error tracking to log client-side JS error. Doesn't really check to see what tags are firing, but will let...
sublimetext2,sublimetext3,sublimetext,code-snippets
The $ character is a special character used in snippets to add fields or variables. So, you need to escape all your $ characters in your snippet with the \ key. You can read it in Sublime Text docs: If you want to get a literal $, you have to...
c#,asp.net-mvc,razor,code-snippets
I think it's just an oversight on Microsoft's part. I found the snippets path by choosing Tools -> Code Snippets Manager, selected HTML as language and selected ifcs4. The path for the snippet is (for VS 2013): C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Visual Studio 2013\Snippets\HTML\1033\ASP.NET MVC 4\ifcs.snippet I updated the...
Creating a "Dicebag" is quite simple; it takes little to no effort at all to write it. However, there are a few things that need to be described before continuing. A die(plural "dice") can never be zero or negative, thus when writing the class we need to prepare for that...
jquery,ajax,sublimetext,code-snippets,sublimetext3
You have to escape the dollar sign: \$
visual-studio-2012,code-snippets,ssdt
It seems that VS Content Installer has no support for deploying SSDT code snippets. There is a posted idea on visualstudio.uservoice.com which requests this feature, but it is still open. I did not found any other resources related to this issue. There is a possible workaround, which needs testing: You...
javascript,typescript,sublimetext3,code-snippets
You have to add a typescript source to your snippets scope. <scope>source.js, source.ts</scope> There is a exemple of snippet that you can find in the TypeScript package: <snippet> <content><![CDATA[ class ${2:ClassName}${3: extends ${4:AnotherClass}} { $5 ${6:constructor}(${7:argument}) { ${0:// code...} } } ]]></content> <tabTrigger>class</tabTrigger> <scope>source.ts</scope> <description>class …</description> </snippet> ...
now the problem I am having understanding is what is happening when the int is added to the cplx Actually the addition is not <int> + <cplx> but <int> + <cplx>* (in words an integer plus a pointer to a complex). So what you're dealing with here is what's...
What you´re printing as HCF (GCD) is always 0, because it´s dr and the loop runs until dr is 0. The "problem" is that you´re printing dd after dr without any space etc.between them, so it appears as one number. If you remove the second printf, only the 0 of...
code-snippets,modx-revolution,modx-getresources
What you have is exactly right, probably something to do with getResources. ~ try calling it uncached. if not, try setting your context key as a context setting so you can call it as [[++context_key]] or in your context snippet set it as a placeholder: [[!context]] [[!getResources? &parents=`0` ... &sortby=`menuindex`...
Set the cursor after the first brace within the switch statement and press Alt + Enter. You will see the option to generate switch labels.
You can write your snippet in ST2 and then export it to HTML using ExportHtml. This plugin allows the exporting of a document in ST2 to an HTML file or to BBCode. It duplicates ST2's theme colors and font styles. ...
visual-studio-2010,visual-studio,code-snippets,vsinstaller
Here's an easier way (and, as a bonus, it works): Download the Snippets Designer: Write the code directly in Visual Studio: var RowName = new HtmlTableRow(); var Cell1Name = new HtmlTableCell(); var Cell2Name = new HtmlTableCell(); RowName.Cells.Add(Cell1Name); RowName.Cells.Add(Cell2Name); Right-click and select "Export as Snippet" This puts the code in the...
javascript,jquery,sublimetext3,code-snippets
You can escape special characters like $ with the backslash key \. Example: \$(document).ready(function(){ ${1} }); Result: $(document).ready(function(){ ${1} }); ...
It's code snippet. You can create your own code snippet in XCode. Type the template code in XCode Copy it and drag it to the comment section in the Utility panel Give a title and completion shortcut Whenever you type the shortcut, XCode will show the auto-completion option ...
c#,.net,visual-studio,namespaces,code-snippets
Is not supported. You should read more carefully the page you linked: If you create a Visual Basic code snippet, you have the ability to specify the necessary references and Imports statements required for your code to run. Why do you expect this should work in C#?...
.net,visual-studio,testing,resharper,code-snippets
ReSharper doesn't show Visual Studio snippets in code completion, but they're still there. Type testc and hit tab. It should expand the snippet.
sublimetext2,sublimetext,sublimetext3,code-snippets
You can use a .sublime-completions file. These are JSON-formatted files that contain the target scope at the top, then a series of completions with a trigger and contents. For example, the following snippet <snippet> <content><![CDATA[function ${1:function_name} (${2:argument}) { ${0:// body...} }]]></content> <tabTrigger>fun</tabTrigger> <scope>source.js</scope> <description>Function</description> </snippet> can be turned into this...