Skip to content

Instantly share code, notes, and snippets.

@phinze
phinze / gist:3196054
Created July 29, 2012 04:27
contents of open source sparrow mac.zip
.
├── PLCrashReporter.h
├── app
│   └── Sparrow.app
│   └── Contents
│   ├── Frameworks
│   │   ├── EtPanKit.framework
│   │   │   ├── EtPanKit -> Versions/Current/EtPanKit
│   │   │   ├── Resources -> Versions/Current/Resources
│   │   │   └── Versions
sudoers::allowed_command { 'everyone-can-run-riak-admin-as-riak':
command => '/usr/sbin/riak-admin',
user => 'ALL',
run_as => 'riak',
require_password => false
}
@phinze
phinze / metasyntactic_puns.rb
Created May 3, 2012 05:31
CLI with sub-commands using dynamic dispatch and a whitelist
# revision of https://gist.github.com/2583429 with a whitelist
class PunCommands
PUN_WORDS = %w[foo bar baz]
def self.foo
puts "you could have fooed me"
end
def self.bar
@phinze
phinze / metasyntactic_puns.rb
Created May 3, 2012 05:21
CLI with sub-commands using dynamic dispatch
class PunCommands
def self.foo
puts "you could have fooed me"
end
def self.bar
puts "guy walks into a bar"
end
def self.baz
@phinze
phinze / disinterested_cat.rb
Created May 3, 2012 05:14
simple dynamic dispatch example
class DisinterestedCat
def speak
puts "..."
end
def play
puts "...<look away>"
end
end
@phinze
phinze / brew-cask.rb
Created March 10, 2012 07:57
a homebrew formula for installing brew-cask
require 'formula'
class BrewCask < Formula
homepage 'https://github.com/phinze/brew-cask/'
head 'https://github.com/phinze/brew-cask.git'
skip_clean :all
def install
@phinze
phinze / rename.sh
Created December 26, 2011 04:34
Rename sets of files with numbers
# rename a set of files with numbers by adding one
#
# example renaming a set of files like SC-123A.MUS, SC-123B.MUS, etc.
#
# move files 165-169 up one to be 166-170, leaving room for a new 165
# ./rename.sh *{165..169}*.MUS
#
filenames="$@"
mkdir renamed
@phinze
phinze / gist:1275965
Created October 10, 2011 17:53
moviepass chicago theaters
Arlington Theatre
Bensenville Theater
Buffalo Grove Theaters
Catlow Theatre
Classic Cinemas Charlestowne 18
Classic Cinemas Cinema 12
Classic Cinemas Elk Grove Theatre
Classic Cinemas Fox Lake Theatre
Classic Cinemas Lake Theatre
Classic Cinemas North Riverside Mall Theatre
@phinze
phinze / gist:1240576
Created September 25, 2011 12:51
#shoes / 2011-09-24
Day changed to 24 Sep 2011
00:36 = Remear|mbp [~remear@c-71-195-213-205.hsd1.ut.comcast.net] quit (Remote host closed the connection)
01:20 = ckolderup [~ckolderup@ool-43560858.dyn.optonline.net] quit (Quit: ZNC - http://znc.sourceforge.net)
01:20 + ckolderup_ [~ckolderup@ool-43560858.dyn.optonline.net] joined #shoes
02:23 = coreypurcell [~coreypurc@coreypurcell.xen.prgmr.com] quit (Ping timeout: 260 seconds)
02:37 + coreypurcell [~coreypurc@coreypurcell.xen.prgmr.com] joined #shoes
04:38 = Remear [~remear@unaffiliated/remear] quit (Ping timeout: 260 seconds)
09:41 + spiralofhope [~spiralofh@S01060026f3e14dd8.ok.shawcable.net] joined #shoes
10:00 = spiralofhope [~spiralofh@S01060026f3e14dd8.ok.shawcable.net] quit (Remote host closed the connection)
10:34 + phinze [~phinze@99-46-70-76.lightspeed.cicril.sbcglobal.net] joined #shoes
@phinze
phinze / Gemfile
Created September 18, 2011 17:41
Exception when trying to run external commands with shebang'ed ruby under bundle exec
source "http://rubygems.org"
# just need at least one dependency to generate the bug; this could be any gem
gem "rake"