Skip to content

Instantly share code, notes, and snippets.

@brumm
Created July 27, 2017 11:30
Show Gist options
  • Save brumm/8f6bbf8db3dd4ccacf03f36f849253ab to your computer and use it in GitHub Desktop.
Save brumm/8f6bbf8db3dd4ccacf03f36f849253ab to your computer and use it in GitHub Desktop.
'.source.css':
'rgba':
'prefix': 'rgba'
'body': 'rgba(0, 0, 0, 0.5)'
'rgbaw':
'prefix': 'rgbaw'
'body': 'rgba(255, 255, 255, 0.5)'
'.source.less':
'rgba':
'prefix': 'rgba'
'body': 'rgba(0, 0, 0, 0.5)'
'rgbaw':
'prefix': 'rgbaw'
'body': 'rgba(255, 255, 255, 0.5)'
".source.js.jsx":
"import":
prefix: "import"
body: "import $1 from '${2:$1}'"
"console.log('lol')":
prefix: "lol"
body: "console.log('lol')"
"constructor":
prefix: "cstr"
body: "constructor() {\n\t${1}\n}"
"react constructor":
prefix: "rcstr"
body: "constructor(props) {\n\tsuper(props)\n\t${1}\n}"
"console.log":
prefix: "log"
body: "console.log($1)"
"React: cx({ ... })":
prefix: "cx"
body: "cx({\n\t$1: $2\n})"
"React: forceUpdate(...)":
prefix: "fup"
body: "forceUpdate(${1:callback})"
"React: propTypes { ... }":
prefix: "pt"
body: "propTypes: {\n\t${1}: React.PropTypes.${2:string}\n},"
"React: setState({ ... })":
prefix: "sst"
body: "this.setState({\n\t${1}: ${2}\n})"
"React: setState(({ ... }) => ({ ... }))":
prefix: "sstf"
body: "this.setState(({ ${1} }) => ({ $1 }))"
"React: this.props.":
prefix: "props"
body: "this.props.${1}"
"React: this.state.":
prefix: "state"
body: "this.state.${1}"
"React: render(component, container, [callback])":
prefix: "rrc"
body: "ReactDOM.render(${1:<$2 />}, ${3:document.body}${4:, ${5:callback}})"
# React >0.13
"React: componentDidMount() { ... }":
prefix: "cdm"
body: "componentDidMount() {\n\t${1}\n}"
"React: componentDidUpdate(pp, ps) { ... }":
prefix: "cdup"
body: "componentDidUpdate(prevProps, prevState) {\n\t${1}\n}"
"React: componentWillMount() { ... }":
prefix: "cwm"
body: "componentWillMount() {\n\t${1}\n}"
"React: componentWillReceiveProps(np) { ... }":
prefix: "cwr"
body: "componentWillReceiveProps(nextProps) {\n\t${1}\n}"
"React: componentWillUnmount() { ... }":
prefix: "cwun"
body: "componentWillUnmount() {\n\t${1}\n}"
"React: componentWillUpdate(np, ns) { ... }":
prefix: "cwu"
body: "componentWillUpdate(nextProps, nextState) {\n\t${1}\n}"
"React: static defaultProps = { ... }":
prefix: "dp"
body: "static defaultProps = {\n\t${1}\n}"
"React: this.state = { ... }":
prefix: "is"
body: "this.state = {\n\t${1}: ${2}\n}"
"React: static propTypes = { ... }":
prefix: "pt"
body: "static propTypes = {\n\t${1}: React.PropTypes.${2:string}\n}"
"React: class skeleton":
prefix: "rcd"
body: "import React from 'react'\n\nexport default class $1 extends React.Component {\n\trender () {\n\t\treturn (\n\t\t\t${2:<div />}\n\t\t)\n\t}\n}\n\n"
"React: stateless component":
prefix: "rcs"
body: "import React from \'react\'\n\nconst $1 = ({ ${2:prop} }) => (\n\t\t${3:<div />}\n\t)"
"React: render() { return ... }":
prefix: "ren"
body: "render() {\n\treturn (\n\t\t${1:<div />}\n\t)\n}"
"React: shouldComponentUpdate(np, ns) { ... }":
prefix: "scu"
body: "shouldComponentUpdate(nextProps, nextState) {\n\t${1}\n}"
"React: const { ... } = this.props":
prefix: "cprops"
body: "const { ${1} } = this.props"
"React: const { ... } = this.state":
prefix: "cstate"
body: "const { ${1} } = this.state"
"PropTypes.func.isRequired":
prefix: "ptf"
body: "PropTypes.func.isRequired"
"PropTypes.string.isRequired":
prefix: "pts"
body: "PropTypes.string.isRequired"
"PropTypes.object.isRequired":
prefix: "pto"
body: "PropTypes.object.isRequired"
"PropTypes.array.isRequired":
prefix: "pta"
body: "PropTypes.array.isRequired"
"PropTypes.bool.isRequired":
prefix: "ptb"
body: "PropTypes.bool.isRequired"
"PropTypes.number.isRequired":
prefix: "ptn"
body: "PropTypes.number.isRequired"
"PropTypes.node.isRequired":
prefix: "ptnode"
body: "PropTypes.node.isRequired"
"PropTypes.element.isRequired":
prefix: "pte"
body: "PropTypes.element.isRequired"
"PropTypes.any.isRequired":
prefix: "ptany"
body: "PropTypes.any.isRequired"
"PropTypes.shape({...}).isRequired":
prefix: "ptshape"
body: "PropTypes.shape({ $1: $2 }).isRequired"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment