Created
November 16, 2018 16:52
-
-
Save tonysaffo/75da92eb805537d48e4949cf0f0dc68f to your computer and use it in GitHub Desktop.
Atom js snippets
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
'.source.js': | |
'anonymous function': | |
'prefix': 'f' | |
'body': 'function(){$1}' | |
'jquery click function': | |
'prefix': 'c' | |
'body': """ | |
.click(function(){ | |
${1} | |
}); | |
""" | |
'delegate click': | |
'prefix': 'd' | |
'body': """ | |
$(document).delegate('${1}', "click", function(e){ | |
${2} | |
}); | |
""" | |
'jquery onload': | |
'prefix': 'l' | |
'body': """ | |
$(function(){ | |
${1} | |
}); | |
""" | |
'for loop': | |
'prefix': 'ff' | |
'body': """ | |
for(var i = 0; i < ${1}.length; i++){ | |
${2} | |
} | |
""" | |
'try catch': | |
'prefix': 'try' | |
'body': """ | |
try{ | |
} catch(err) { | |
console.error('ERROR EXCEPTION IN TRY CATCH ${1}', err) | |
} | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment