Skip to content

Instantly share code, notes, and snippets.

@ediamin
Last active September 13, 2016 16:22
Show Gist options
  • Save ediamin/9e8b372ee92eead47ad3c0cab84e5fb7 to your computer and use it in GitHub Desktop.
Save ediamin/9e8b372ee92eead47ad3c0cab84e5fb7 to your computer and use it in GitHub Desktop.
Atom - Custom snippets
# 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'
#
# Each scope (e.g. '.source.coffee' above) can only be declared once.
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it in the
# Atom Flight Manual:
# http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson
#
# Begin custom snippet :: Edi Amin
'.source.js':
'console.log()':
'prefix': 'console.log'
'body': 'console.log($1)'
'Self invoking anonymous function':
'prefix': 'siaf'
'body': """
;(function($) {
'use strict';
${1}
})(jQuery);
"""
'Vue Component':
'prefix': 'vuecomp'
'body': """
Vue.component('${1:name}', {
template: _TEMPLATE,
data() {
return {
${2}
};
},
computed: {
},
methods: {
}
});
"""
'.text':
'<?php ?> with line break':
'prefix': 'phplb'
'body': """
<?php
\t$1
?>
"""
'.source.php':
'echo <br>':
'prefix': 'echobr'
'body': """
echo '<br>';
"""
'echo <pre>':
'prefix': 'echopre'
'body': """
echo '<pre>';
print_r( \$${1:var} );
echo '</pre>';$2
"""
'Error log':
'prefix': 'error_log'
'body': """
error_log( print_r( \$${1:var}, true ) );$2
"""
'Public Function':
'prefix': 'pubfunc'
'body': """
public function ${1:functionName}(\$${2:arg}) {
${3:// start here}
}
"""
################
# WP ERP #
################
'Email Campaign':
'prefix': 'erp-email-campaign'
'body': 'erp-email-campaign'
'ERP Deals':
'prefix': 'erp-deals'
'body': 'erp-deals'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment