Public Gists by mbleigh

Gravatar
Sun Nov 15 06:22:14 -0800 2009
1
2
3
module Rack
  class Pictopus
    def initialize(app, output_path)
Gravatar
Tue Oct 20 10:28:31 -0700 2009
1
2
3
# Once you've included your Jeweler tasks and your Jeweler::Gemcutter tasks...
 
namespace :release do
Gravatar
Sun Sep 20 20:35:30 -0700 2009
1
2
3
require 'fakeweb'
FakeWeb.allow_net_connect = false
 
Gravatar
Tue Aug 25 09:43:12 -0700 2009
1
2
3
# Just kidding!
teams.voteable.each do |team|
  if team == my_team
Gravatar
Wed Jul 22 13:40:34 -0700 2009
1
2
3
class SoundWalk < ActiveRecord::Base
  belongs_to :user
 
Gravatar
Fri May 08 12:24:22 -0700 2009
1
2
3
Some Definitions
================
 
Gravatar
Thu Apr 30 12:12:59 -0700 2009
1
2
3
# Let's say we have this:
 
class User < ActiveRecord::Base
Gravatar
Wed Apr 22 20:09:10 -0700 2009
1
2
3
# OptionsProxy creates a proxy object with attribute accessors
# and defaults.
 
Gravatar
Wed Apr 22 16:19:56 -0700 2009
1
2
3
class User < TwitterAuth::GenericUser
  def refresh_twitter_attributes!
    update_twitter_attributes(twitter.get('/account/verify_credentials'))
Gravatar
Thu Apr 02 09:05:33 -0700 2009
1
2
3
app_name = ask("What is your application called?")
puts "\nBefore this generator runs you will need to register your Twitter application for OAuth at http://twitter.com/oauth_clients, then enter the consumer key and secret below:\n\n"
consumer_key = ask("OAuth Consumer Key:")
Gravatar
Mon Mar 23 16:53:47 -0700 2009
1
2
3
Autotest.add_hook :initialize do |at|
  at.add_mapping(/app\/shared\/.*\.rb/) do
    at.files_matching /^app\/shared\/spec\/(models)\/.*_spec\.rb/
Gravatar
Tue Feb 10 13:18:14 -0800 2009
1
2
3
  jQuery.githubUser = function(username, callback) {
    jQuery.getJSON("http://github.com/api/v1/json/" + username + "?callback=?", callback);
  }
Gravatar
Thu Jan 22 09:18:44 -0800 2009
1
2
3
// ==UserScript==
// @name Twitter Search Plus
// @namespace intridea
Gravatar
Tue Jan 13 14:23:34 -0800 2009
1
2
3
>> ActionController::UrlWriter.default_url_options
=> {:host=>nil}
>> ActionController::UrlWriter.default_url_options[:host] = 'abc.com'
Gravatar
Tue Nov 18 10:01:16 -0800 2008
1
2
3
#!/usr/bin/perl
 
# Present.ly Post-Commit Hook for Git
Gravatar
Fri Aug 29 09:13:38 -0700 2008
1
2
3
# I hear that aliasing lambda is bad, but this is
# much more readable...