Skip to content

Instantly share code, notes, and snippets.

@jhanstra
Created April 27, 2017 15:14
Show Gist options
  • Save jhanstra/2db461354c5bee599dd66583010536ee to your computer and use it in GitHub Desktop.
Save jhanstra/2db461354c5bee599dd66583010536ee to your computer and use it in GitHub Desktop.
# 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
# Types of Snippets #
# - Javascript (.source.js)
# - Markdown (.source.gfm)
### Javascript ###
'.source.js':
'Import React':
'prefix': 'ir'
'body': "import React from 'react'"
'Console log':
'prefix': 'log'
'body': 'console.log("$1", $1)'
### HTML ###
'.text.html':
'HTML 5':
'Style Tag':
'prefix': 'style'
'body': '<link rel="stylesheet" href="$1">'
'Script Tag':
'prefix': 'script'
'body': '<script src="$1" type="text/javascript"></script>'
'Lorem Ipsum':
'prefix': 'lorem'
'body': 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus.'
'Lorem Ipsum - Short':
'prefix': 'lor'
'body': 'Aenean ultricies mi vitae est. Mauris placerat eleifend leo.'
'.source.scss':
'Background Image':
'prefix': 'bg-image'
'body': """
background-image: url('$1');
background-size: cover;
background-repeat: no-repeat;
background-position: center center
"""
'Placeholder styles':
'prefix': 'placeholder'
'body': """
::-webkit-input-placeholder {
$1
}
::-moz-placeholder {
$1
}
:-ms-input-placeholder {
$1
}
"""
'.source.gfm':
'Travel Log':
'prefix': 'tlog'
'body': """
---
date: 2017-$1
layout: log
location: $2
coffee: $3
office: $4
restaurants: $5
bars: $6
beers: $7
hikes:
movies:
games:
climbing:
books:
links:
achievements:
personal_growth:
places:
description:
private_notes:
---
$10
"""
'Portfolio Entry':
'prefix': 'portfolio'
'body': """
---
title: $1
subtitle: $2
url: $3
startDate: $4
endDate: $5
layout: work
type: $6
employer: $7
---
"""
'.source.liquid':
'Config.yml':
'prefix': 'config'
'body': """
development:
password: $1
theme_id: "$3"
store: $2.myshopify.com
ignore_files:
- config.yml
- Gruntfile.js
- package.json
- node_modules/
- .git/
production:
password: $1
theme_id: "$4"
store: $2.myshopify.com
timeout: 60s
readonly: true
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment