This file contains hidden or 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
# Using redirection, run a command only if the previous command's exit code is 0, | |
command &>/dev/null && conditionalcommand | |
# example: | |
tmux has-session -t mysession &>/dev/null && echo "mysession exists!" |
This file contains hidden or 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
# --------------------------------------------------- | |
# Correct workflow when working with forked upstreams. | |
# --------------------------------------------------- | |
git fetch origin --prune | |
# If you haven't made any local changes: | |
git checkout branch-name | |
git merge --ff-only origin/branch-name | |
# If you have local changes, you'll get this error: fatal: Not possible to fast-forward, aborting. |
This file contains hidden or 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
# -------------------------------------------------------------------------------------------------------- | |
# BASIC ACTIONS | |
# ------------------------------------------------------------------------------------------------------- | |
# start up a new machine | |
docker-machine create --driver virtualbox dev | |
# list VMs | |
docker-machine ps |
This file contains hidden or 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
sd |
This file contains hidden or 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
/*============================================================================= | |
= Scales | |
=============================================================================*/ | |
.text-xxs { | |
font-size: 0.8rem; | |
} | |
.text-xs { | |
font-size: 1rem; | |
} |
This file contains hidden or 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
/*============================================================================= | |
= Scales | |
=============================================================================*/ | |
// | |
// Text | |
// | |
$textSizes: ( | |
(xxs, .8rem), | |
(xs, 1rem), | |
(sm, 1.2rem), |
This file contains hidden or 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
{ | |
"root": true, | |
"env": { | |
"es6": true, | |
"browser": true | |
}, | |
"rules": { | |
"indent": [2, "tab"], | |
"strict": [2, "global"], | |
"no-use-before-define": 0, |
This file contains hidden or 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
# manually specify syntax | |
:set syntax=js | |
// view 'recent' files | |
:buffers // open a 'recent' file | |
:buffer nameFromList | |
// diff file against any arbitrary text in v-split |
This file contains hidden or 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
const arr = [1,2,3]; | |
const otherArr = [3,4,5]; | |
arr.some(a => otherArr.some(b => a === b)); // => true | |
// using a collection and comparing with keys | |
const collection = [{a: 1}, {a: 2}, {a: 3}]; | |
const collection2 = [{a: 3}, {a: 4}, {a: 5}]; | |
collection.some(a => collection2.some(b => a.a === b.a)); // => true |
This file contains hidden or 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
// | |
// * Given some data that looks like this: | |
// | |
// let data = [ | |
// { | |
// key: 'a', | |
// value: 'a1', | |
// children: [ | |
// { | |
// key: 'b', |