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
# Color shortcuts | |
RED=$fg[red] | |
YELLOW=$fg[yellow] | |
GREEN=$fg[green] | |
WHITE=$fg[white] | |
BLUE=$fg[blue] | |
RED_BOLD=$fg_bold[red] | |
YELLOW_BOLD=$fg_bold[yellow] | |
GREEN_BOLD=$fg_bold[green] | |
WHITE_BOLD=$fg_bold[white] |
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
# Install brew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Install wget | |
brew install wget | |
# Install Chrome | |
wget https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg | |
open googlechrome.dmg |
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
module.exports = { | |
entry: './src/index.js', | |
output: { | |
filename: 'build/bundle.js' | |
} | |
} |
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
function add (a, b) { | |
return a + b | |
} | |
module.exports = add |
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
function add (a, b) { | |
return a + b | |
} | |
export default add |
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
import add from './add' | |
console.log(add(1, 2)) |
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
function add (a, b) { | |
return a + b | |
} | |
const sum = (...args) => args.reduce(add) | |
export default sum |
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
var exit = require('exit') | |
var join = require('path').join | |
var fullPackagePath = join(process.cwd(), 'package.json') | |
var pkg = require(fullPackagePath) | |
const varsToInterpolate = process.argv.slice(2) | |
const vars = getInterpolations(varsToInterpolate) | |
function getInterpolations() { |
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
# For zsh only: don't put this for bash | |
precmd() { eval "$PROMPT_COMMAND" } | |
__OLD_PATH=$PATH | |
function updatePATHForNPM() { | |
export PATH=$(npm bin):$__OLD_PATH | |
} | |
function node-mode() { | |
PROMPT_COMMAND=updatePATHForNPM |
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
function getQueryStringAsObject(uri) { | |
const link = document.createElement('a') | |
link.href = uri || location | |
const queryString = link.search | |
const qsAsObject = {}; | |
queryString.replace( | |
/([^?=&]+)(?:=([^&]*))?/g, | |
function($0, $1, $2) { | |
qsAsObject[$1] = decodeURI($2) || true; | |
} |
OlderNewer