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 'cgi' | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
class SXSWPodcast | |
attr_reader :title, :description, :date, :link | |
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 'osx/cocoa' | |
include OSX | |
OSX.require_framework 'ScriptingBridge' | |
itunes = SBApplication.applicationWithBundleIdentifier( 'com.apple.itunes' ) | |
itunes_window = itunes.windows.first |
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 'active_record' | |
class Salutations | |
attr_accessor :greeting, :farewell | |
def initialize(greeting, farewell) | |
@greeting = greeting | |
@farewell = farewell | |
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
def bang | |
raise | |
ensure | |
return | |
end | |
bang | |
puts "you wouldn't expect to get here" |
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
# http://dnssd.rubyforge.org/dnssd/ | |
# http://xmpp.org/extensions/xep-0174.html | |
# http://home.gna.org/xmpp4r/ | |
require 'rubygems' | |
require 'dnssd' | |
require 'xmpp4r' | |
# An example of how to send messages to iChat with the bonjour chat protocol | |
# using ruby. |
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 'thread' | |
require 'rubygems' | |
require 'net/irc' | |
# undo weirdness in the net/irc library, so that we get NoMethodError when we | |
# call a method that doesn't exist | |
class Net::IRC::Client | |
remove_method :method_missing if defined? method_missing | |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>untitled</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |
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 "securerandom" | |
class RollingCounter | |
# :call-seq: RollingCounter.new(redis_client, max_window_seconds) -> counter | |
# | |
# Create a new counter instance, that will store/retrieve counts with | |
# +redis_client+ and return counts within the last +max_window_seconds+ | |
# seconds. | |
# |
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 "eventmachine" | |
require "statsd" # statsd-ruby gem | |
module EventMachine | |
class Statsd < ::Statsd | |
class ConnectionWrapper | |
def initialize(em_connection) | |
@em_connection = em_connection | |
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
source :rubygems | |
gem "activerecord", "3.1.4" | |
platforms :mri do | |
gem "mysql2" | |
end | |
platforms :jruby do | |
gem "activerecord-jdbcmysql-adapter" |
OlderNewer