This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pull-request { | |
hub pull-request -h $(__github_remote_origin):$(__github_current_branch) | |
} | |
function __github_remote_origin { | |
# Finds the origin on github if it is https or git | |
echo "$1`git remote -v | grep -e "^origin.* (push)" | sed "s#origin[[:blank:]]https://github.com/\([^/]*\)\/.*#\1#" | sed "s#origin.*:\([^/]*\).*push.*#\1#"`" | |
} | |
function __github_current_branch { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Measurements | |
def cup | |
self * 48 | |
end | |
alias_method :cups, :cup | |
def tsp ; self ; end | |
alias_method :tsps, :tsp | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rspec' | |
class Recipe | |
attr_accessor :name | |
def initialize(name) | |
@name = name | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module BeginState | |
def add_player | |
# really add the player | |
end | |
def add_ship | |
# really do it | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1 pod.local my.pod.local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
require 'sunlight' | |
Sunlight::Base.api_key = 'e179a6973728c4dd3fb1204283aaccb5' | |
filename = ARGV.first || "event_attendees.csv" | |
options = {:headers => true, :header_converters => :symbol} | |
def clean_zipcode(zipcode) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task :default => :first | |
def open_file(filename) | |
system "ruby event_manager.rb #{filename}" | |
end | |
desc "open the first event attendees" | |
task :first do | |
open_file "event_attendees.csv" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
require 'sunlight' | |
require 'sinatra' | |
Sunlight::Base.api_key = 'e179a6973728c4dd3fb1204283aaccb5' | |
representatives = Sunlight::Legislator.all_in_zipcode(90210) | |
filename = ARGV.first || "event_attendees.csv" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'La Crosse, WI' | |
code: LSE | |
directions: http://g.co/maps/62ufz | |
image: 'lacrosse-image.jpg' | |
website: http://www.cityoflacrosse.org/index.aspx?NID=851 | |
rental_cars: http://www.cityoflacrosse.org/index.aspx?NID=882 | |
description: La Crosse is the closest flight destination. It is right | |
on the Mississippi and about an hour away. It is a small airport so we | |
<strong>definitely recommend</strong> making a rental car reservation ahead of time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class String | |
def capitalize | |
self.gsub(/^[a-z]|\s+[a-z]/) { |a| a.upcase } | |
end | |
end |