Skip to content

Instantly share code, notes, and snippets.

@davidguttman
Created April 4, 2016 20:53
Show Gist options
  • Save davidguttman/f5b9902bd34b3cf9f45b004d450a68d9 to your computer and use it in GitHub Desktop.
Save davidguttman/f5b9902bd34b3cf9f45b004d450a68d9 to your computer and use it in GitHub Desktop.
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
# '.source.coffee':
# 'Console log':
# 'prefix': 'log'
# 'body': 'console.log $1'
#
'.source.js':
'Console Log Mirror':
'prefix': 'lm'
'body': 'console.log(\'$1\', $1)$0'
'Console Log':
'prefix': 'ls'
'body': 'console.log(${1})${0}'
'Console Error':
'prefix': 'ce'
'body': 'console.error(${1})${0}'
'Return if Error':
'prefix': 'rce'
'body': 'if (err) return ${1:console.error}(err)$0'
'module.exports':
'prefix': 'me'
'body': 'module.exports'
'Tag':
'prefix': 'tag'
'body': "<${1:div}${2: className='${3:name}'}>$0</${1:div}>"
'Self-closing Tag':
'prefix': 'stag'
'body': "<${1:div}${2: className='${3:name}'} />$0"
'||=':
'prefix': 'ore'
'body': '${1:thing} = ${1:thing} || ${2:default}${0}'
'document.createElement':
'prefix': 'dce'
'body': "document.createElement('${1:div}')$0"
'NODE_ENV':
'prefix': 'env'
'body': 'process.env.NODE_ENV'
'JSON Stringify':
'prefix': 'js'
'body': 'JSON.stringify(${1:obj})$0'
'JSON Parse':
'prefix': 'jp'
'body': 'JSON.parse($1)$0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment