Skip to content

Instantly share code, notes, and snippets.

@joshmanders
joshmanders / README.md
Last active November 9, 2020 13:48
My Docker Command

My Docker Command

When working with docker toolbox, sometimes I type get tripped up trying to type docker-machine env default and accidentally type docker machine env default instead. This bash script is a helper to allow you to do just that.

Put it in your $PATH and chmod +x my-docker. Then create an alias in your profile with alias docker="my-docker"

Now when you type docker machine env this will automatically proxy anything after machine to docker-machine.

Same goes for docker compose up proxies to docker-compose up.

@joshmanders
joshmanders / bos-style.zsh-theme
Last active November 9, 2017 23:07
zsh-themes
# Bos Style, based on Cobalt2 Theme
# https://github.com/wesbos/Cobalt2-iterm
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
##
### Segment drawing
# A few utility functions to make it easy and re-usable to draw segmented prompts
Verifying that "joshmanders.id" is my Blockstack ID. https://onename.com/joshmanders
@joshmanders
joshmanders / .md
Last active May 10, 2017 09:30
Synth Love Affair Artists

Current list of Artists in Synth Love Affair playlist.

  1. Arcade Summer
  2. Betamaxx
  3. Carpenter Brut
  4. College
  5. Crockett
  6. Dance With the Dead
@joshmanders
joshmanders / README.md
Last active March 23, 2017 20:27
Git Clubhouse.io Command

Git Clubhouse.io Command

This command takes a story ID and connects to the API using your token and gets the story with that ID, determines the type and title of the story.

After it has gathered that, it slugifies the title and creates a branch in the format of {type}/{id}-{title} so for example:

❯ git clubhouse 82
Switched to a new branch 'feature/82-login-my-account-menu-item'
#! /usr/bin/env bash
# Usage: git-io URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
URL="$1"
CODE="$2"
@joshmanders
joshmanders / cask
Last active February 2, 2017 23:10
Homebrew Cask Upgrade
#!/usr/bin/env bash
readonly local caskroom="/usr/local/Caskroom"
upgrade () {
casks=($(brew cask list))
for cask in ${casks[@]}; do
current="$(brew cask info ${cask} | sed -n '1p' | sed -n 's/^.*: \(.*\)$/\1/p')"
installed=($(ls ${caskroom}/${cask}))
const doSomething = () => new Promise((resolve, reject) => resolve('hi'))
doSomething().then((result) => console.log(result)) // hi
undefined:2
{"Type":"volume","Action":"mount","Actor":{"ID":"b3436ea2370baa183beab30919225e276ae30edd1ecf64028d0972cd49a8cc75","Attributes":{"container":"31a69ef987031b39430128b53a27df572ef81383a9ee6141622be6a77c6aad7b","destination":"/data/configdb","driver":"local","propagation":"","read/write":"true"}},"time":1471525057,"timeNano":1471525057948621037}
^
SyntaxError: Unexpected token { in JSON at position 295
at Object.parse (native)
at DestroyableTransform.res.pipe.through.obj [as _transform] (/Users/josh/Projects/niftyco/docker/events.js:11:22)
at DestroyableTransform.Transform._read (/Users/josh/Projects/niftyco/docker/node_modules/readable-stream/lib/_stream_transform.js:159:10)
at DestroyableTransform.Transform._write (/Users/josh/Projects/niftyco/docker/node_modules/readable-stream/lib/_stream_transform.js:147:83)
at doWrite (/Users/josh/Projects/niftyco/docker/node_modules/readable-stream/lib/_stream_writable.js:313:64)
const { spawn } = require('child_process')
const grunt = spawn('grunt', {
env: Object.assign({}, process.env, { PATH: `./node_modules/.bin:${process.env.PATH}` }),
stdio: 'inherit'
})
grunt.on('close', (code) => {
console.log(`Grunt closed with error code ${code}`)
process.exit(code)