Skip to content

Instantly share code, notes, and snippets.

@me97esn
Last active February 9, 2017 11:33
Show Gist options
  • Save me97esn/51d7c60cb6d25735f9184df9632902e1 to your computer and use it in GitHub Desktop.
Save me97esn/51d7c60cb6d25735f9184df9632902e1 to your computer and use it in GitHub Desktop.
atom snippets
'.source.js':
'module.exports':
'prefix': 'mod'
'body': 'module.exports = {}'
'description': 'CommonJS module exports'
'rightLabelHTML': '<span style="color:#ff0">Emil</span>'
'Tape test':
'prefix': 'test'
'body': """test('should ${1:do something}',t =>{
t.plan(1)
t.equal(1,0)
})"""
'description': 'Tape test function'
'rightLabelHTML': '<span style="color:#ff0">Emil</span>'
'console.log':
'prefix': 'con'
'body': 'console.log($1)'
'description': 'Stringify with formatting'
'rightLabelHTML': '<span style="color:#ff0">Emil</span>'
'JSON.stringify':
'prefix': 'JSON'
'body': 'JSON.stringify($1, null, 4)'
'description': 'Stringify with formatting'
'rightLabelHTML': '<span style="color:#ff0">Emil</span>'
'then.log':
'prefix': 'then'
'body': '''then(${1:arg} => {
console.log(\'${1:arg}\', JSON.stringify( ${1:arg} ))
return ${1:arg}
})
'''
'description': '.then with console.log of the arg'
'rightLabelHTML': '<span style="color:#ff0">Emil</span>'
'.catch':
'prefix': 'catch'
'body': 'catch(e => console.error(e))'
'description': 'Add a promise catch'
'rightLabelHTML': '<span style="color:#ff0">Emil</span>'
'log.info':
'prefix': 'log'
'body': "log.info('$1')"
'description': 'Kth log info'
'rightLabelHTML': '<span style="color:#ff0">Emil</span>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment