This file contains 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 parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
} | |
function proml { | |
case $TERM in | |
xterm*) |
This file contains 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 'open-uri' | |
DEBUG = true | |
abort("Come back when you get a mac!") unless RUBY_PLATFORM =~ /darwin/ | |
abort("The actors have come down with a bad case of laryngitis") unless system("which -s say") | |
class Actor | |
attr_reader :voice | |
def initialize(voice) |
This file contains 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
namespace :test do | |
desc "Generate code coverage with rcov" | |
task :coverage do | |
rm_rf "doc/coverage/coverage.data" | |
rm_rf "doc/coverage" | |
mkdir "doc/coverage" | |
rcov = %(rcov --rails --aggregate doc/coverage/coverage.data --exclude gems --text-summary -Ilib:test --html -o doc/coverage test/**/*_test.rb) | |
system rcov | |
system "open doc/coverage/index.html" if PLATFORM['darwin'] | |
end |
This file contains 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 'rubygems' | |
require 'sinatra' | |
require 'geocoder' | |
get '/' do | |
view | |
end | |
post '/locate' do | |
result = nil |
This file contains 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
#!/usr/bin/env ruby | |
require "rubygems" | |
require "twitter" | |
abort("I can't let you do that Dave!") unless RUBY_PLATFORM =~ /darwin/ | |
def remove_urls(tweet) | |
tweet.text.gsub(/http:\/\/[^ ]+/, '') | |
end |
This file contains 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'icalendar' | |
require 'date' |
This file contains 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'fog' | |
RACKSPACE_USERNAME = "racker" | |
RACKSPACE_API_KEY = "23423423" | |
#create connection | |
connection = Fog::Compute.new({ | |
:provider => 'Rackspace', |
This file contains 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
if Fog::VERSION == "1.9.0" | |
Fog::Logger.warning "PATCHING Fog::Rackspace::Databases to include latest endpoints and fix request issue" | |
require 'rubygems' | |
require 'fog' | |
Fog::Rackspace::Databases.send :remove_const, :DFW_ENDPOINT | |
Fog::Rackspace::Databases.send :remove_const, :LON_ENDPOINT | |
Fog::Rackspace::Databases.send :remove_const, :ORD_ENDPOINT |
This file contains 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
Traceback (most recent call last): | |
File \"/usr/lib/python2.6/dist-packages/eventlet/wsgi.py\", line 336, in handle_one_response | |
result = self.application(self.environ, start_response) | |
File \"/usr/lib/python2.6/dist-packages/newrelic-1.9.0.21/newrelic/api/web_transaction.py\", line 563, in __call__ | |
result = application(environ, _start_response) | |
File \"/usr/lib/python2.6/dist-packages/newrelic-1.9.0.21/newrelic/api/object_wrapper.py\", line 220, in __call__ | |
self._nr_instance, args, kwargs) | |
File \"/usr/lib/python2.6/dist-packages/newrelic-1.9.0.21/newrelic/api/function_trace.py\", line 81, in literal_wrapper | |
return wrapped(*args, **kwargs) | |
File \"/usr/lib/python2.6/dist-packages/reddwarf/common/wsgi.py\", line 147, in __call__ |
This file contains 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
if Fog::VERSION == "1.10.0" | |
Fog::Logger.warning "PATCHING Fog::SSH::Real so that the timeout is user configurable" | |
require 'rubygems' | |
require 'fog' | |
module Fog | |
module SSH | |
class Real |
OlderNewer