shift + ⌘ + p
-- toggle command palette
⌘ + /
-- toggle line/selection comment
alt + shift + s
-- show available 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. | |
#------------------------------------------------------------------------------- | |
# CoffeScript |
function hexToRgb(hex) { | |
// Expand shorthand form ("#FFF") to full form ("#FFFFF") | |
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; | |
hex = hex.replace(shorthandRegex, function(m, r, g, b) { | |
return r + r + g + g + b + b; | |
}); | |
// return hex values | |
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); | |
return result ? { | |
r: parseInt(result[1], 16), |
<table data-comprowssor> | |
<caption>Middle Jurassic sections</caption> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Period <small>[Mya]</small></th> | |
<th>Duration <small>[My]</small></th> | |
<th>Species</th> | |
</tr> | |
</thead> |
Ctrl+A
and Ctrl+C
)alt+click
on the mask icon/thumbnail)/* | |
+-----------------------------------------------------------------+ | |
| Created by Chirag Mehta - http://chir.ag/projects/ntc | | |
|-----------------------------------------------------------------| | |
| ntc js (Name that Color JavaScript) | | |
+-----------------------------------------------------------------+ | |
All the functions, code, lists etc. have been written specifically | |
for the Name that Color JavaScript by Chirag Mehta unless otherwise |
// declarations | |
var positions = []; | |
// Returns a random integer between min (included) and max (excluded) | |
// Using Math.round() will give you a non-uniform distribution! | |
function getRandomInt(min, max) { | |
return Math.floor(Math.random() * (max - min)) + min; | |
} | |
// generate random positions |