My Recent Pastes (540 and counting)

Pastes by rsl (540 and counting)

Pages:

Below are the 15 most recent pasties by rsl.

July 08, 2008
8:35AM EDT
by rsl

#wrapper
  form
    ...
    button [submit]
  #cancel

July 07, 2008
12:46PM EDT
by rsl

<% if post.user %>
  <%= link_to post.user.name, post.user, :class => "author" %>
<% end %>

July 07, 2008
10:08AM EDT
by rsl

class Foo < ActiveRecord::Base
  before_validation :check
  
  def check
    puts "i'm being checked in foo's before validation"

June 28, 2008
6:32PM EDT
by rsl

default_run_options[:pty] = true

set :scm,                    :git
# Make sure it's the private clone URI
set :repository,             "git@github.com:rsl/justify_yr_hate.git"

June 28, 2008
6:22PM EDT
by rsl

set :db_host,        "localhost"
set :db_user,        "root"
set :db_password,    ""

after "deploy:setup", "hate:setup"

June 26, 2008
2:11PM EDT
by rsl

sqlite> explain select * from users where users.name = 'rsl';
addr  opcode         p1    p2    p3    p4             p5  comment      
----  -------------  ----  ----  ----  -------------  --  -------------
0     Trace          0     0     0     explain select * from users where users.name = 'rsl';  00               
1     String8        0     1     0     rsl            00               

June 24, 2008
5:15PM EDT
by rsl

Time::DATE_FORMATS.merge!(
  :default => lambda { |time|
    if time.year == Time.now.year
      if time.to_date == Time.now.to_date
        time.strftime("%I:%M %p").sub(/^0/, "")

June 24, 2008
3:33PM EDT
by rsl

# view

<h2>Edit news entry</h2>
<%= debug(@news)%>
<%= error_messages_for :news %>

June 24, 2008
11:47AM EDT
by rsl

    it "should render an upload form" do
      get :new
      response.should render_template("new")
      # if it renders... it's always a success.
      # if it renders... it's not a redirect.

June 22, 2008
2:09PM EDT
by rsl

  map.resources :orders, :member => {
    :paypal_checkout => :get, :paypal_agreement => :get,
    :paypal_confirm => :get, :paypal_complete => :post,
    :check_agreement => :get, :check_complete => :get,
    :purge_all => :delete} do |order|

June 22, 2008
9:46AM EDT
by rsl

>> Account.find :all, :conditions => ["created_at > ? and created_at < ?", 1.year.ago, Time.now], :select => "created_at"
=> [#<Account created_at: "2008-06-10 19:25:28">, #<Account created_at: "2008-06-10 19:25:28">]

June 12, 2008
4:05PM EDT
by rsl

  it "should respond with :unprocessable_entity if the json is invalid" do
    @json_hash.delete(:content)

    post :create, :json => @json_hash.to_json, :format => "xml"
    # or...

June 12, 2008
3:11PM EDT
by rsl

class UsersController < ApplicationController
  before_filter :login_required, :except => [:create, :new]
  # GET /users
  # GET /users.xml
  def index

June 12, 2008
2:49PM EDT
by rsl

require File.dirname(__FILE__) + '/../spec_helper'

describe User do
  def valid_attributes(args = {})
    {

June 12, 2008
2:26PM EDT
by rsl

require File.dirname(__FILE__) + '/../spec_helper'

describe UsersController do
  def valid_attributes(args = {})
    {

Next page

Previous page