Skip to content

Instantly share code, notes, and snippets.

Working from home

Josh Delsman voxxit

Working from home
View GitHub Profile
voxxit /
Last active Aug 29, 2015
Backbone.View function caching
# Set a view's attribute equal to the return value of
# a (usually expensive) callback. If the prime argument
# is true, it will call it again, priming the cache
# with the latest data.
Backbone.View::cache = (name, callback, prime = false) ->
if !@[name]? or prime is true
@[name] = callback()
voxxit / host
Last active Aug 29, 2015
Command to quickly tail the rails log
View host
brew install multitail
multitail -l "ssh staging 'railslog'" -l "ssh production 'railslog'"
voxxit / .zshrc
Last active Aug 29, 2015
My .zshrc
View .zshrc
export EDITOR="atom -n"
export GIT_EDITOR="atom -w"
edit() atom -n $*
alias nano="atom" # until muscle memory goes away...
alias ttv="cd ~/Repositories/totaltv"
alias fs="be foreman start"
voxxit / gist:67e4402ea978a2784f24
Last active Aug 29, 2015
To uninstall rbenv/ruby-build and install rvm w/ ruby 2.1.2
View gist:67e4402ea978a2784f24
brew uninstall rbenv
brew uninstall ruby-build
rm -rf $HOME/.rbenv
exec $SHELL -l
cd $HOME
\curl -sSL | bash -s stable --ruby=2.1.2
source $HOME/.rvm/scripts/rvm
voxxit / Dockerfile
Created Sep 12, 2014
Compiling from source on Busybox w/ Alpine Linux 3.0
View Dockerfile
FROM uggedal/alpine-3.0
# - update the source repositories
# - add the 'build-base' metapackage, which includes: binutils, gcc, make, patch, libc-dev, g++
# - do your stuff to wget, gunzip, tar xf, configure, make, make install, etc.
# - uninstall/purge the build-base package & dependencies
RUN apk update && apk add build-base && \
# ... && \
apk del build-base --purge
voxxit / Vagrantfile
Last active Aug 29, 2015
CoreOS on Vagrant - Just git clone this gist & vagrant up! :)
View Vagrantfile
# -*- mode: ruby -*-
# # vi: set ft=ruby :
require 'fileutils'
Vagrant.require_version ">= 1.6.0"
CLOUD_CONFIG_PATH = File.join(File.dirname(__FILE__), "cloud-config.yml")
require File.join(File.dirname(__FILE__), "config.rb")
voxxit / bijective.rb
Created Sep 19, 2014
Ruby class to encode/decode using the bijective function (to avoid the "birthday paradox" in URL shorteners) — Based on:
View bijective.rb
class Bijective
ALPHA = "UDip8sOCeQFMtZ1SmwbuKgH4N3P0r2B9o765LnWcqdxJRjkfyhIzlVvXAGTEaY".split(//)
BASE = 62
def self.encode(i)
return ALPHA[0] if i == 0
"".tap do |s|
s << ALPHA[i.modulo(BASE)] and i /= BASE while i > 0
chown -R splunk:splunk /var/splunk
exec /sbin/setuser splunk /opt/splunk/bin/splunk start splunkd --nodaemon
voxxit /
Last active Aug 29, 2015
Script to change hostname on Ubuntu >= 13.04
# Example:
# \curl -fsSL | sudo bash /dev/stdin
hostnamectl set-hostname ${_hostname}
View Dockerfile
FROM ubuntu:12.04
MAINTAINER Joshua Delsman <>
ENV APP_DATA /var/www/owncloud/data
ADD /Release.key
ADD ./nginx.conf /etc/nginx/sites-available/owncloud
ADD ./