Skip to content

Instantly share code, notes, and snippets.

@velopert
Created August 18, 2016 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velopert/fda936bee7493eb64314f82adfc28095 to your computer and use it in GitHub Desktop.
Save velopert/fda936bee7493eb64314f82adfc28095 to your computer and use it in GitHub Desktop.
dfgdfg
# 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:
# https://atom.io/docs/latest/using-atom-basic-customization#cson
'.source.js':
'React Component':
'prefix': 'rc'
'body': '''
import React, { Component, PropTypes } from 'react';
const propTypes = {
};
const defaultProps = {
};
class ${1:MyComponent} extends React.Component {
constructor(props) {
super(props);
}
render() {
return(
<div>${1:MyComponent}</div>
);
}
}
${1:MyComponent}.propTypes = propTypes;
${1:MyComponent}.defaultProps = defaultProps;
export default ${1:MyComponent};
'''
'Import Component':
'prefix': 'impc'
'body': '''
import ${1:MyComponent} from './${1:MyComponent}';
'''
'React PropTypes and DefaultProps':
'prefix': 'rpd'
'body': '''
${1:MyComponent}.propTypes = {
};
${1:MyComponent}.defaultProps = {
};
'''
'REST API COMMET':
'prefix': 'restc'
'body': '/*
\n\tAPI: ${1:method} ${2:/}
\n\tbody: ${3:body}
\n\tparams:
\n\t\t${4:params}
\n\tdescription: ${5:description}
\n*/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment