Skip to content

Instantly share code, notes, and snippets.

View schie's full-sized avatar
:octocat:
doing stuff

Dustin Schie schie

:octocat:
doing stuff
View GitHub Profile
@schie
schie / docker-commands.md
Created October 23, 2017 22:48
Useful Docker Commands

Delete All Containers

$ docker rm $(docker ps -a -q)

Delete All Images

$ docker rmi $(docker images -q)
@schie
schie / string-to-color.js
Created February 3, 2018 18:35
Converting a random string to a hex color
function stringTColor(str) {
let hash = 0;
for (let i = 0; i < str.length; i++) {
hash = str.charCodeAt(i) + ((hash << 5) - hash);
}
let color = '#';
for (let i = 0; i < 3; i++) {
let value = (hash >> (i * 8)) & 0xFF;
color += ('00' + value.toString(16)).substr(-2);
}
@schie
schie / git-alias.sh
Created October 31, 2018 21:18
git aliases
# In .bashrc, .bash_profile, .zshrc, insert following the following
alias g=git
alias ga='git add'
alias gaa='git add --all'
alias gapa='git add --patch'
alias gau='git add --update'
alias gb='git branch'
alias gba='git branch -a'
alias gbd='git branch -d'