Skip to content

Instantly share code, notes, and snippets.

View benmcredmond's full-sized avatar

Ben McRedmond benmcredmond

View GitHub Profile
filetype off
call pathogen#runtime_append_all_bundles()
filetype plugin indent on
set nocompatible
set modelines=0
set smarttab
set autoindent
set expandtab
@benmcredmond
benmcredmond / gist:1021753
Created June 12, 2011 16:54
Example Git Ruby Interface
class Git
@@git_methods = [:add, :bisect, :branch, :checkout, :clone, :commit, :diff, :fetch, :grep, :init, :log, :merge, :mv, :pull, :push, :rebase, :reset, :rm, :show, :status, :tag]
def method_missing(method, *args, &block)
if(@@git_methods.include?(method.to_sym))
key_value_options = args.delete(-1) if args[-1].kind_of?(Hash)
key_value_options ||= nil
command = 'git '
post '/new' do
begin
paste = save_paste(params)
redirect "/#{paste.id}"
rescue ArgumentError, RuntimeError => e
liquid :new, :locals => {
:author => params[:author],
:desc => params[:desc],
:raw => params[:raw],
:error => e.message
require 'rubygems'
require 'hpricot'
require 'net/http'
class AlbumArt
@api_key = "yourapikey"
# get_artwork_url_for_size :size => "small" (|| medium || large)
# :artist => "Artist name", :album => "Album Name"
def self.get_url(params)