Created
February 14, 2010 23:18
-
-
Save cowboy/304332 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
################################################################ | |
name: jQuery plugin closure | |
tab trigger: jqp | |
scope selector: source.js | |
code: | |
(function(\$${2:,window}${3:,undefined}){ | |
'$:nomunge'; // Used by YUI compressor. | |
${0:// OMG LETS MAKE A PLUGIN!!} | |
})(jQuery${1:,this}); | |
################################################################ | |
name: loopy | |
tab trigger: loopy | |
scope selector: source.js | |
code: | |
(function loopy(){ | |
${0:// cool stuff here} | |
setTimeout( loopy, ${1:250} ); | |
})(); | |
################################################################ | |
name: instant-invoke anonymous function | |
tab trigger: fnow | |
scope selector: source.js | |
code: | |
(function($2){ | |
${0:// cool stuff here} | |
})($1); | |
################################################################ | |
name: html 5 document | |
tab trigger: html | |
scope selector: | |
code: | |
<!DOCTYPE HTML> | |
<html lang="en-US" class="no-js"> | |
<head> | |
<script type="text/javascript">(function(h,a){h[a]=h[a].replace(/\bno-js\b/,'js')})(document.documentElement,'className')</script> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>$1</title> | |
</head> | |
<body> | |
$0 | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment