Skip to content

Instantly share code, notes, and snippets.

View gerred's full-sized avatar
:octocat:

Gerred Dillon gerred

:octocat:
View GitHub Profile
package org.testgame
trait Named {
def name: String
}
trait Described {
def description: String
}
trait Item extends Named with Described {
@gerred
gerred / gist:951692
Created May 2, 2011 14:37 — forked from jsklassen/gist:950059
Jason Klassen Graduation Code - Specs thread-safe multi-threaded tests with partially applied functions
/* User: Jason Klassen
*/
package extensions {
import actors.threadpool.LinkedBlockingQueue
object LinkedBlockingQueueExtensions {
implicit def linkedBlockingQueueExt[A](source: LinkedBlockingQueue[A]) = new LinkedBlockingQueueExt[A](source)
require "twitter"
require "sunlight"
data_pos = DATA.pos
last_id = DATA.read.to_s[/\d+/]
last_id = last_id.to_i if last_id
DATA.reopen(__FILE__, "a+")
Twitter.configure do |config|
@gerred
gerred / rails_3_1_beta_1_changes.md
Created May 9, 2011 17:48 — forked from ryanb/rails_3_1_rc4_changes.md
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 Beta 1

  • The -j option of the application generator accepts an arbitrary string. If passed "foo", the gem "foo-rails" is added to the Gemfile, and the application JavaScript manifest requires "foo" and "foo_ujs". As of this writing "prototype-rails" and "jquery-rails" exist and provide those files via the asset pipeline. Default is "jquery". [fxn]

  • jQuery is no longer vendored, it is provided from now on by the jquery-rails gem. [fxn]

  • Prototype and Scriptaculous are no longer vendored, they are provided from now on by the prototype-rails gem. [fxn]

  • The scaffold controller will now produce SCSS file if Sass is available [Prem Sichanugrist]

module Templater
extend self
def render_template(template, opts = {})
Tilt.new(build_file(template, opts)).render.inspect.split("\\n").join
end
private
def build_file(file, opts)
relative_path = opts[:path] || "/app/views/templates"
class App
def call(env)
[200, {"Content-Type" => "text/html"}, ["Hello!"]]
end
end
class Upper
def initialize(app)
@app = app
end
source :gemcutter
gem 'goliath'
[alias]
st = status
ci = commit
co = checkout
br = branch
ls = branch
s = status
a = add
b = branch
d = diff
@gerred
gerred / .irbrc
Created June 17, 2011 18:27
My .irbrc file
if defined?(::Bundler)
global_gemset = ENV['GEM_PATH'].split(':').grep(/ruby.*@global/).first
if global_gemset
all_global_gem_paths = Dir.glob("#{global_gemset}/gems/*")
all_global_gem_paths.each do |p|
gem_path = "#{p}/lib"
$LOAD_PATH << gem_path
end
end
end
@gerred
gerred / gist:1158222
Created August 19, 2011 22:45
travis-worker failure
➜ travis-worker git:(master) bundle exec rake test --trace
** Invoke test (first_time)
** Execute test
Loaded suite /Users/gerred/.rvm/gems/ruby-1.9.2-p180@global/gems/rake-0.9.2/lib/rake/rake_test_loader
Started
.....................................................Using Travis::Worker::Builders::Ruby
.Using Travis::Worker::Builders::Ruby
....F...................................
Finished in 0.749319 seconds.