Skip to content

Instantly share code, notes, and snippets.

View zph's full-sized avatar

Zander Hill zph

View GitHub Profile
@zph
zph / vim.rb
Created May 20, 2012 00:44 — forked from mgrouchy/vim.rb
Vim formula for Homebrew
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'https://vim.googlecode.com/hg/', :revision => '6c318419e331'
version '7.3.515'
def features; %w(tiny small normal big huge) end
def interp; %w(lua mzscheme perl python python3 tcl ruby) end
@zph
zph / fft.rb
Created May 22, 2012 00:46 — forked from mro/fft.rb
Discrete Fast Fourier Transform from 'Meyberg, Vachenauer: Hoehere Mathematik II, Springer Berlin, 1991, page 332'
#!/usr/bin/env ruby
require 'complex'
class Array
# DFT and inverse.
#
# Algorithm from
# 'Meyberg, Vachenauer: Hoehere Mathematik II, Springer Berlin, 1991, page 332'
#
# See http://blog.mro.name/2011/04/simple-ruby-fast-fourier-transform/
@zph
zph / gist:3335343
Created August 12, 2012 23:31 — forked from gagnedan/gist:2897806
Install Nokogiri on Mac OSX Lion including libiconv using Homebrew
# Install libxml2 using Homebrew
# If you don't have Homebrew, follow the instructions at:
# https://github.com/mxcl/homebrew/wiki/Installation
# -------------------------------------------------------
brew install libxml2
# Install libxslt from source code
# If you don't have wget, follow the instructions at:
# http://www.mactricksandtips.com/2008/07/installing-wget-on-your-mac-for-terminal.html
# Or use Homebrew:
@zph
zph / tmux_iterm2.rb
Created August 24, 2012 03:29
Brew script for 'Tmux for iTerm2'
require 'formula'
class TmuxIterm2 < Formula
url 'http://iterm2.googlecode.com/files/tmux-for-iTerm2-20120108.tar.gz'
md5 'f15d9f567b9b029482bb7b3227ee7ac3'
homepage 'http://code.google.com/p/iterm2/downloads/detail?name=tmux-for-iTerm2-20120108.tar.gz&can=2&q='
depends_on 'libevent'
def install
@zph
zph / rspec-syntax-cheat-sheet.rb
Created August 25, 2012 12:56 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@zph
zph / trello-cards-from-csv.rb
Created October 5, 2012 19:33 — forked from joshmcarthur/trello-cards-from-csv.rb
A Ruby script to import Trello cards from a CSV file
#!/usr/bin/env ruby
# You can skip this bit if you wish - you will need the 'ruby-trello' gem installed, and
# optionally, 'foreman' to run the script with.
require 'bundler/setup'
Bundler.require
require 'trello'
require 'csv'
@zph
zph / .vimrc
Created December 20, 2012 05:19 — forked from skwp/.vimrc
" Run the current file in a ConqueTerm, great for ruby tests
let g:ConqueTerm_InsertOnEnter = 0
let g:ConqueTerm_CWInsert = 1
nmap <silent> <Leader>r :call RunRubyCurrentFileConque()<CR>
nmap <silent> <Leader>R :call RunRakeConque()<CR>
nmap <silent> <Leader>c :execute 'ConqueTermSplit script/console'<CR>
nmap <silent> <Leader>i :execute 'ConqueTermSplit pry'<CR>
nmap <silent> <Leader>b :execute 'ConqueTermSplit /bin/bash --login'<CR>
nmap <silent> <Leader>S :call RunRspecCurrentFileConque()<CR>
@zph
zph / gist:4588491
Created January 21, 2013 19:19 — forked from Gregg/gist:968534

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
# Re-write for run by @_ZPH
# OO Ruby
gem = File.open('Gemfile').readlines.reject { |l| l =~ /lame/ }.join
File.write('Gemfile', gem)
# obtuse bash
grep -v "lame" Gemfile > !!3.new && mv !!3{.new,}
# ruby one liner
ruby -i -ne 'print unless /lame/' Gemfile
Reluctantly crouched at the command line
keyboards clicking and clacking in time
the green bar flashes, the vim pops up
churning, and burning, they yearn for server up
they deftly maneuver and regex to rename
fingers flying fast keyboards in flame
reckless and wild, they commit and they push
their prowess is potent though they sit on their tush.
as they speed through the release, the deploy goes out
they all get up and pour themselves stout