Created
June 25, 2018 03:20
-
-
Save siliconavengers/2717fc69076943881715c9eadd6ee8d7 to your computer and use it in GitHub Desktop.
Zek's snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
'.string.html': | |
'Elixir block echo': | |
'prefix': 'pe' | |
'body': '<%= $1 %>' | |
'Elixir block silent': | |
'prefix': 'pee' | |
'body': '<% $1 %>' | |
'.source.elixir': | |
'IO.inspect 2 lines': | |
'prefix': 'iins' | |
'body': ''' | |
IO.inspect($1, label: "===$1===") | |
''' | |
'IO.inspect': | |
'prefix': 'insp' | |
'body': 'IO.inspect($1)' | |
'IO.puts': | |
'prefix': 'put' | |
'body': 'IO.puts($1)' | |
'IO.puts and inspect': | |
'prefix': 'ins' | |
'body': 'IO.puts("$1 #{inspect($1)}")' | |
'Logger info': | |
'prefix': 'log' | |
'body': 'Logger.info "[${1:<function_name>}] ${2:thing}: #{inspect(${2:thing})}"' | |
'Logger error': | |
'prefix': 'err' | |
'body': 'Logger.error "[${1:<function_name>}] ${2:thing}: #{inspect(${2:thing})}"' | |
'ABO.StoreFront': | |
'prefix': 'abo' | |
'body': 'ABO.StoreFront' | |
'Repo.preload': | |
'prefix': 'pre' | |
'body': 'Repo.preload(:$1)' | |
'Exredis.Api': | |
'prefix': 'era' | |
'body': 'Exredis.Api.' | |
'ShorterMaps': | |
'prefix': 'sh' | |
'body': '~M{ $1 }' | |
'ShorterMaps import': | |
'prefix': 'shi' | |
'body': 'import ShorterMaps' | |
'.source.js': | |
'Console Log': | |
'prefix': 'llog' | |
'body': 'console.log("$1", $1)' | |
'define props': | |
'prefix': 'dp' | |
'body': '$1={$1}' | |
'import from': | |
'prefix': 'impf' | |
'body': 'import $1 from "$2"' | |
'Analytics Event': | |
'prefix': 'ana' | |
'body': ''' | |
analyticsEvent({ | |
eventCategory: '$1', | |
eventAction: '${2:Action}', | |
eventLabel: `$3`, | |
$4 | |
}); | |
''' | |
'.source.js.jsx': | |
'style tag': | |
'prefix': 'st' | |
'body': 'style={$1} ' | |
'Toast': | |
'prefix': 'toast' | |
'body': ''' | |
Toast.show({ | |
text: "$1", | |
type: "success", | |
duration: 1000 | |
}); | |
''' | |
'basic stateless React component': | |
'prefix': 'stateless' | |
'body': ''' | |
import React from "react"; | |
import { compose } from "recompose"; | |
import { | |
Body, | |
Button, | |
Container, | |
Content, | |
Header, | |
Icon, | |
Input, | |
Item, | |
Left, | |
List, | |
ListItem, | |
Right, | |
Spinner, | |
Text, | |
Title, | |
Toast | |
} from "native-base"; | |
const ${1:SomeScreen} = props => { | |
const {} = props; | |
return ( | |
<Container> | |
<Header> | |
<Left /> | |
<Body> | |
<Title>${2:Title}</Title> | |
</Body> | |
<Right /> | |
</Header> | |
<Content padder> | |
$3 | |
</Content> | |
</Container> | |
) | |
}; | |
const enhance = compose(); | |
const $1Enhanced = enhance($1); | |
$1Enhanced.navigationOptions = { | |
header: null | |
// headerTitle: "Attendee List" | |
}; | |
export default $1Enhanced; | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment