Public Gists by agibralter

Gravatar
Wed Nov 18 13:44:22 -0800 2009
1
2
3
require "#{File.dirname(__FILE__)}/../vendor/bundler_gems/environment"
 
module Rails
Gravatar
Wed Nov 11 13:40:42 -0800 2009
1
2
3
class SomeMiddleware
  def initialize(app, session_key)
    @app = app
Gravatar
Tue Sep 29 13:43:43 -0700 2009
1
2
3
def reset_session_id
  saved_session_data = self.session
  reset_session
Gravatar
Mon Aug 24 14:25:33 -0700 2009
1
2
3
# ...
 
if defined?(PhusionPassenger)
Gravatar
Fri Jun 26 12:41:15 -0700 2009
1
2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
Gravatar
Wed Jun 17 09:21:27 -0700 2009
1
2
3
%table
  %tr
    %th name
Gravatar
Mon May 18 21:47:44 -0700 2009
1
2
3
#!/usr/bin/env ruby
require 'rubygems'
require 'daemons'
Gravatar
Mon May 18 21:47:41 -0700 2009
1
2
3
# If we ever end up running God / Starling on other environments than production.
# we'll have to find a different way to set the values below.
STARLING_PORT = 15151
Gravatar
Tue May 12 14:47:41 -0700 2009
1
2
3
module ApplicationHelper
  
  def ul(opts={}, &block)
Gravatar
Tue Apr 21 22:20:05 -0700 2009
1
2
3
class Comment < ActiveRecord::Base
  
  belongs_to :post
Gravatar
Sat Apr 11 08:57:27 -0700 2009
1
2
3
/opt/local/bin/ruby /opt/local/lib/ruby/gems/1.8/gems/rspec-1.2.2/bin/spec --autospec spec/controllers/password_resets_controller_spec.rb -O spec/spec.opts
F..
 
Gravatar
Fri Apr 10 13:14:47 -0700 2009
1
2
3
# like reddit's sub-reddits located @ reddit.com/r/[name_of_reddit]
map.namespace :c, :path_prefix => 'c/:context_name' do |c|
 
Gravatar
Fri Apr 03 21:45:36 -0700 2009
1
2
3
val ids = List(1, 2, 3)
 
ids.foreach { id =>
Gravatar
Fri Apr 03 12:42:06 -0700 2009
1
2
3
try {
 
  val conn = DriverManager.getConnection("jdbc:mysql://...")
Gravatar
Sun Mar 15 18:44:34 -0700 2009
1
2
3
require File.dirname(__FILE__) + '/../../spec_helper'
 
describe Admin::BaseController do
Gravatar
Thu Feb 26 14:28:47 -0800 2009
1
2
3
# ...
 
Scenario: having current questions in multiple urtaks
Gravatar
Mon Jan 05 20:45:20 -0800 2009
1
2
3
class Post < ActiveRecord::Base
  has_many :comments
  
Gravatar
Fri Jan 02 21:30:04 -0800 2009
1
2
3
module ActiveRecordEachBy
  # This method lets you iterate over the results of a .find, in groups.
  # (Basically an interface to LIMIT.)
Gravatar
Thu Dec 25 19:27:27 -0800 2008
1
2
3
it "should display the enter link" do
  helper.actions_for(@context).should have_tag('a', 'enter')
end
Gravatar
Thu Dec 25 01:20:47 -0800 2008
1
2
3
groups:
 
| id | data |