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 July 30, 2012 01:35
vim.rb Homebrew recipe based on dupes
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
# Get stable versions from hg repo instead of downloading an increasing
# number of separate patches.
url 'https://vim.googlecode.com/hg/', :tag => 'v7-3-548'
version '7.3.548'
head 'https://vim.googlecode.com/hg/'
@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 / tasknote.sh
Created September 4, 2012 23:36
Tasknote (slightly modified)
#!/bin/bash
###############################################################################
# tasknote - associate note file with individual tasks in taskwarrior
#
# Copyright 2011, Alan Bowen, bowen@tcnj.edu.
# All rights reserved.
#
# based on taskopen - file based notes with taskwarrior
#
@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'
#!/usr/bin/env ruby
require 'nokogiri'
require 'open-uri'
#
# Download and replace current Metes and Bounds App
DL_LINK = "http://www.tabberer.com/sandyknoll/files/MetesandBoundsOSX.dmg"
DMG_NAME = DL_LINK.split('/')[-1]
APP_NAME = "Metes and Bounds.app"
DL_DESTINATION = "#{ENV['HOME']}/Downloads/#{DMG_NAME}"
# Basic Ruby Primitives
# String
"Test String".upcase.split("S") # => ["TE", "T ", "TRING"]
# Array
a = [1, 2, 3]
a[0..1] # => [1, 2]
# Hash
require 'xlsx_writer'
class TrelloArchiver
def initialize(options = {:board => "", :filename => "trello_backup", :format => 'xlsx'})
@options = options
FileUtils.mkdir("archive") unless Dir.exists?("archive")
end
def createspreadsheet()
module TrelloArchiver
class Authorize
include Trello
include Trello::Authorization
def initialize(config)
@config = config
end