My Recent Pastes (435 and counting)

Pastes by technoweenie (435 and counting)

Pages:

Below are the 15 most recent pasties by technoweenie.

June 13, 2006
11:12AM EDT
by technoweenie

irb(main):001:0> foo = lambda do
irb(main):002:1*   puts "hello"
irb(main):003:1> end
=> #<Proc:0x0000bef0@(irb):1>
irb(main):004:0> foo.call

June 11, 2006
9:11PM EDT
by technoweenie

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <%= stylesheet_link_tag controller.controller_name %>

June 11, 2006
9:20AM EDT
by technoweenie

## tag.rb
class Tag < ActiveRecord::Base
  has_many :taggings
  has_many :invoices, :through => :taggings, :order => 'invoices.created_at desc'

June 11, 2006
8:28AM EDT
by technoweenie

  def list
    if params[:sections].blank?
      @section = site.sections.find_by_name('home')
      list_section_articles_with(:main)
    else 

June 11, 2006
6:37AM EDT
by technoweenie

class OpenIdController < ApplicationController
  open_id_consumer :required => [:email, :nickname]

  def begin
    # If the URL was unusable (either because of network conditions,

June 10, 2006
10:52AM EDT
by technoweenie

## acts_as_attachment 60 second wipe out
class Attachment < ActiveRecord::Base
  acts_as_attachment
end

June 09, 2006
12:18PM EDT
by technoweenie

ActionController::TestRequest.class_eval do
  def user_agent
    "blah"
  end
end

June 09, 2006
12:15PM EDT
by technoweenie

+ 1
- 1
== 0

June 07, 2006
11:40PM EDT
by technoweenie

code.gsub! /&lt;code/,   '<code'
code.gsub! /&lt;\/code/, '</code'
code.gsub! /code&gt;/,   'code>'

June 07, 2006
11:33PM EDT
by technoweenie

lines = code.split "\n"
      lines.delete_at 0 if lines[0].strip == ''
      code = lines * "\n"

June 07, 2006
11:26PM EDT
by technoweenie

>> puts s
a
b
=> nil
>> puts s.gsub(/^/m, '!')

June 06, 2006
11:02PM EDT
by technoweenie

def show
  @paste = Paste.find(params[:id])
  if params[:key] and params[:key]==User.new(@paste.nick).magic_mojo
    session[:login] =@paste.nick
    return redirect_to(:action => 'show', :id => @paste.id)

June 06, 2006
7:55PM EDT
by technoweenie

def self.with_complete(&block)
  with_scope(:find => { :conditions => ["(body is not null and body!='') or asset is not null"] }, &block)
end

June 03, 2006
5:03PM EDT
by technoweenie

require 'coderay'
class SnippetParser
  include Reloadable
  def initialize(text)
    @text = text.to_s

June 03, 2006
10:38AM EDT
by technoweenie

irb(main):001:0> def mail template
irb(main):002:1>   m = 'mail object'
irb(main):003:1>   yield m if block_given?
irb(main):004:1>   puts 'yielded!'
irb(main):005:1> end

Previous page