Skip to content

Instantly share code, notes, and snippets.

View jeremyolliver's full-sized avatar
☁️
Yak shaving a cloud somewhere

Jeremy Olliver jeremyolliver

☁️
Yak shaving a cloud somewhere
View GitHub Profile
brew install rbenv ruby-build fasd ag htop
brew install redis postgresql
@jeremyolliver
jeremyolliver / ssh-complete.sh
Created March 9, 2015 01:25
Bash ssh host autocomplete
# Bash autocomplete ssh
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
override['unattended-upgrades']['allowed_origins']['add-this-one'] = true
@jeremyolliver
jeremyolliver / Docker Offerings.md
Last active August 29, 2015 13:56
Docker - Open Source and hosted apps/services offerings

Docker Infastructure Offerings

Platform as a Service (PaaS)

Open Source
Name Source Code Multiple/Single Host
@jeremyolliver
jeremyolliver / Preferences.sublime-settings
Last active December 23, 2015 03:39
sublime user preferences
{
// Useful Visual
"caret_style": "phase",
"highlight_line": true,
"highlight_modified_tabs": true,
// File handling
"default_line_ending": "unix",
"fallback_encoding": "UTF-8",
@jeremyolliver
jeremyolliver / csvscan-extensions.rb
Created July 19, 2013 02:12
Extensions to csvscan gem to get an interface that allows rows to be accessed via a hash with keys defined by the header. Stock gem just returns you an array for each row, and doesn't support headers.
require 'csvscan'
module CSVScan
class ParseError < Exception; end
def self.foreach(file_path, options = {})
parsed_lines, parsed_rows, total_records = 0, 0, 0
first_line, headers = true, Hash.new
@jeremyolliver
jeremyolliver / .slate
Created July 10, 2013 22:51
Slate config file
# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Resize Bindings
# bind right:alt resize +10% +0
# bind left:alt resize -10% +0
@jeremyolliver
jeremyolliver / .gitconfig
Last active December 19, 2015 08:09
Git config
[alias]
st = status
ci = commit
cia = commit -a
co = checkout
dic = diff --cached
rb = rebase
ba = branch -a
b = branch
cp = cherry-pick
@jeremyolliver
jeremyolliver / homebrew-alfred.search
Created June 28, 2013 00:52
Alfred Custom Searchs for Rubyists
class Account < ActiveRecord::Base
scope :open, where(:closed => false)
end
class Group < ActiveRecord::Base
has_many :accounts
end
=> Account.open
Account Load (0.6ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`closed` = 0
=> []