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
upgraded to a real git repository. Please see: http://github.com/jashmenn/irssi-growl |
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
# Nate Murray's ~/.irbrc | |
# | |
# Can be found at: | |
# http://gist.github.com/6626 | |
# git clone git://gist.github.com/6626.git gist-6626 | |
# | |
# Include colorization | |
require 'rubygems' | |
require 'wirble' | |
Wirble.init |
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
# paste whatever is in the clipboard to gist using gisit from http://gist.github.com/5774 | |
# and MacClipboard code from http://project.ioni.st/post/1334#snippet_1334 | |
# this goes in your ~/.irbrc | |
# * todo, change code to update an existing gist | |
def gistit | |
require 'mechanize' | |
require 'gistit' | |
gist = Gistit.new | |
number = gist.paste(MacClipboard.read) # => 12345 | |
gist_url = Gistit::LOGIN_SUCCESS_URL + number.to_s |
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
ruby -e "require 'irb'; IRB.setup(__FILE__); gistit" |
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 to check for a minimum rubygems version | |
# | |
# Can be found at: http://gist.github.com/9998 | |
def check_rubygems_version | |
min_version = '1.2.0' | |
local_version = %x[gem --version].chomp | |
unless local_version >= min_version | |
puts "You need to update the RubyGems utility to #{min_version} using the following" | |
puts "" |
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
#!/usr/bin/env ruby | |
# http://gist.github.com/13686 | |
# Nate Murray 2008 | |
require 'activesupport' | |
# | |
# Examples: | |
# * inflect camelize foo_bar | |
# * echo "foo_bar" | inflect camelize | |
unless method = ARGV[0] | |
puts "usage: #{$0} method string" |
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
# exponential random backoff ala ethernet | |
# Nate Murray, 2008 | |
# inspired by code found in http://files.rubyforge.vm.bytemark.co.uk/rhb/xmpphttpbind.rb | |
class EthernetBackoff | |
class Error < StandardError | |
end | |
# Retries block with exponential random backoff ala ethernet The retry is | |
# based on the return value of &block. If the value evaluates to a boolean | |
# true then the value is returned. Otherwise it will sleep for the calculated |
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
#!/usr/bin/env ruby | |
require 'trollop' | |
require 'pp' | |
opts = Trollop::options do | |
version "#{$0} (c) 2008 Nate Murray" | |
banner <<-EOS | |
http://gist.github.com/16729 | |
A tiny utility to generate graphviz dot files from objects that use pluginaweek's |
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
#!/usr/bin/env ruby | |
# from http://e-huned.com/2008/10/13/random-pronounceable-strings-in-ruby/ | |
require 'rubygems' | |
require 'activesupport' | |
class String | |
def self.random_pronounceable(syllables = 2) | |
alphabet = ('a'..'z').to_a | |
vowels = %w{ a e i o u } |
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
# http://gist.github.com/22673 | |
# Nate Murray 2008 | |
# based on ssh:install_public_key | |
namespace :git do | |
namespace :init do | |
namespace :bare do | |
desc "Init a new bare repository on a foreign server" | |
task :remote do | |
begin | |
( |
OlderNewer