Last active
August 29, 2015 13:56
-
-
Save stephen-james/8842213 to your computer and use it in GitHub Desktop.
Handy JavaScript snippets for Visual Studio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<Header> | |
<Title>Immediately Invoked Function Expression</Title> | |
<Author>Stephen James (@stephenhjames)</Author> | |
<Shortcut>iife</Shortcut> | |
<Description>Code snippet for an Immediately-Invoked Function Expression</Description> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
<SnippetType>SurroundsWith</SnippetType> | |
</SnippetTypes> | |
</Header> | |
<Snippet> | |
<Code Language="JavaScript"><![CDATA[(function() { | |
$selected$$end$ | |
}());]]></Code> | |
</Snippet> | |
</CodeSnippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<Header> | |
<Title>jQuery document.ready wrapping function</Title> | |
<Author>Stephen James (@stephenhjames)</Author> | |
<Shortcut>jqready</Shortcut> | |
<Description>Code snippet for creating a jQuery document.ready wrapping function</Description> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
<SnippetType>SurroundsWith</SnippetType> | |
</SnippetTypes> | |
</Header> | |
<Snippet> | |
<Declarations> | |
</Declarations> | |
<Code Language="JavaScript"><![CDATA[$$(function () { | |
$selected$$end$ | |
});]]></Code> | |
</Snippet> | |
</CodeSnippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<CodeSnippet Format="1.1.0" | |
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<Header> | |
<Title>Revealing Module IIFE</Title> | |
<Author>Stephen James (@stephenhjames)</Author> | |
<Shortcut>rvm</Shortcut> | |
<Description>Code snippet for creating a revealing module immediately | |
invoked function expression</Description> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
<SnippetType>SurroundsWith</SnippetType> | |
</SnippetTypes> | |
</Header> | |
<Snippet> | |
<Declarations> | |
<Literal> | |
<ID>moduleName</ID> | |
<ToolTip>Module Name</ToolTip> | |
<Default>myModule</Default> | |
</Literal> | |
</Declarations> | |
<Code Language="JavaScript"><![CDATA[var $moduleName$ = (function () { | |
$selected$$end$ | |
return { | |
} | |
}());]]></Code> | |
</Snippet> | |
</CodeSnippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment