Skip to content

Instantly share code, notes, and snippets.

View alexsheehan's full-sized avatar

Alex Sheehan alexsheehan

  • San Francisco, CA
View GitHub Profile
@alexsheehan
alexsheehan / docker-commands.md
Last active November 7, 2018 20:26
Useful Docker commands

While doing the docker tutorial, I found that I wanted to do docker start [all containers] or docker stop [all running containers], which isn’t an explicit command. However, with docker ps -q, you can get a list of processes by only their ids. So:
List currently running containers
docker ps
List currently running containers (ids only)
docker ps -q
List all containers
docker ps -a
List all containers (ids only)
docker ps -aq
Start all containers (this doesn't restart containers that are already running)

faker.helpers.randomize(array) - takes an array and returns a random element from it
randomize(['a', 'b', 'c']) => 'b'
randomize(['a', 'b', 'c']) => 'a'
randomize(['a', 'b', 'c']) => 'a'
randomize(['a', 'b', 'c']) => 'c'
randomize(['a', 'b', 'c']) => 'b'
faker.helpers.slugify(string) - makes a string into a slug, i.e. strips spaces and punctuation except for period and separates words with a hyphen
slugify('String. Needs to be a slug?') => 'String.-Needs-to-be-a-slug'
#zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
#in ~/.zsh ZSH_THEME="agnoster"
#you can try chsh -s /bin/bash to set the bash as the default, or chsh -s /bin/zsh to set the zsh as the default.
git clone https://github.com/powerline/fonts
cd fonts
./install.sh
Paste into .zshrc
alias ll='ls -la'
//Common npm packages (eslint is used in VSCode)
npm i -g sass eslint eslint-plugin-react eslint-plugin-mocha jshint live-server
//To install these extensions in VSCode hit Command-Shift-P and type "Shell" until "Shell Command: install 'code' command in path" then run the next line from terminal
code --install-extension coenraads.bracket-pair-colorizer --install-extension dbaeumer.jshint --install-extension dbaeumer.vscode-eslint --install-extension dsznajder.es7-react-js-snippets --install-extension eamodio.gitlens --install-extension HookyQR.beautify --install-extension ms-vscode.sublime-keybindings --install-extension msjsdiag.debugger-for-chrome --install-extension WallabyJs.quokka-vscode --install-extension robertohuertasm.vscode-icons
//Cmd-shift-P, `Shell command: Install 'code' command in PATH`
{
"editor.detectIndentation": false,
"editor.tabSize": 2,
"editor.wordWrap": "on",
"emmet.includeLanguages": {
"javascript": "javascriptreact",
"vue-html": "html"
}
"jshint.options": {