Skip to content

Instantly share code, notes, and snippets.

View micahbrich's full-sized avatar

Micah Rich micahbrich

View GitHub Profile
@aaronbrethorst
aaronbrethorst / t2p.rb
Created May 16, 2011 02:32
Twitter Timeline to Cocoa plist
require 'rubygems'
require 'json'
require 'plist'
require 'open-uri'
File.open("/Users/aaron/Desktop/tweets.plist", 'w') {|f| JSON.parse(open("http://api.twitter.com/1/statuses/user_timeline.json?screen_name=cocoacontrols").read).to_plist}
@mattetti
mattetti / fsevents.rb
Created March 18, 2011 07:19
FSEvents API implementation in MacRuby
if RUBY_ENGINE == 'macruby'
framework 'CoreServices'
WATCHED_EXTS = "rb,builder,erb,nokogiri"
PASSENGER_RESTART_FILE = File.expand_path(File.join(File.dirname(__FILE__), "..", "tmp", "restart.txt"))
DELAY = 3
def modified_files(path)
Dir.glob("#{File.expand_path(path)}/*.{#{WATCHED_EXTS}}").map do |filename|
begin
@kourge
kourge / gist:820296
Created February 10, 2011 10:47
MacFUSE fs in MacRuby, with custom volume icon
framework 'cocoa'
class HelloFS
PATH = '/hello.txt'
def contentsOfDirectoryAtPath(path, error: error)
[PATH.lastPathComponent]
end
def contentsAtPath(path)
#!/usr/bin/env ruby
require 'net/http'
require 'net/https'
user = `git config --global github.user`.strip
token = `git config --global github.token`.strip
raise "Error reading github auth" if user.empty? || token.empty?
auth = {:login => user, :token => token}