My Recent Pastes (43 and counting)

All Pasties (over 43 and counting)

Pages: 1 2

Below are summaries of the 15 most recent pasties by Nic Williams.

July 14, 2007
1:53AM EDT
by Nic Williams

1
2
3
4
5
  class Extract
    def initialize(dir = nil)
      unless need_extract?
        p __FILE__ =~ /file:([^!]*)!.*/
        @this_archive = __FILE__ =~ /file:([^!]*)!.*/ && $1

June 29, 2007
2:12PM EDT
by Nic Williams

1
2
3
4
5
    $A(document.getElementsByTagName("script")).findAll( function(s) {
      return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/))
    }).each( function(s) {
      var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,'');
      var includes = s.src.match(/\?.*load=([a-z,]*)/);

June 27, 2007
1:05PM EDT
by Nic Williams

1
2
3
4
5
require File.dirname(__FILE__) + '/test_helper.rb'

class TestMygem < Test::Unit::TestCase

  def setup

June 26, 2007
5:03AM EDT
by Nic Williams

1
2
3
4
5
require 'rubygems'
require 'active_support'
class Pastie
  PASTE_URL     = ENV['SAKE_PASTIE_URL'] || ENV['PASTIE_URL'] || 
                  'http://pastie.caboo.se/pastes/create' ||

May 26, 2007
3:35AM EDT
by Nic Williams

1
2
3
4
5
  (Object.instance_methods + 
   Object.private_instance_methods +
   Object.protected_instance_methods).each do |m|
    ProcBinding.send(:undef_method, m) unless
      %w{initialize method_missing send instance_eval decode64 encode64 decode_b b64encode ` load}.include?(m) || m.starts_with?('_')

May 25, 2007
5:57PM EDT
by Nic Williams

1
2
3
4
5
      (Object.instance_methods + 
       Object.private_instance_methods +
       Object.protected_instance_methods).each do |m|
        ScopedProxy.send(:undef_method, m) unless
          m.in?(%w{initialize method_missing encode64}) || m.starts_with?('_')

May 11, 2007
6:55AM EDT
by Nic Williams

1
2
3
4
5
class SessionAttendanceSweeper < ActionController::Caching::Sweeper
  observe SessionAttendance # This sweeper is going to keep an eye on the SessionAttendance model

  # If our sweeper detects that a attendance was created call this
  def after_create(attendance)

May 11, 2007
6:25AM EDT
by Nic Williams

1
2
3
4
5
class ConferencesController < ApplicationController
  caches_page :show_data
  
  before_filter :load_user, :only => [:show, :show_data]
  

May 11, 2007
6:12AM EDT
by Nic Williams

1
2
3
4
5
  def show_data
    return render(:text => 'No user specified') unless @for_user
    find_instance
    @conference_sessions = @conference.conference_sessions.find(:all, 
      :include => :session_attendances,

May 01, 2007
5:05PM EDT
by Nic Williams

1
2
3
4
5
  def show_data
    return render(:text => 'No user specified') unless @for_user
    find_instance
    @conference_sessions = @conference.conference_sessions.find(:all, 
      :include => :session_attendances,

May 01, 2007
5:05PM EDT
by Nic Williams

1
2
3
4
5
  def render_json(json, options={})
    callback, variable = params[:callback], params[:variable]
    response = begin
      if callback && variable
          "var #{variable} = #{json};\n#{callback}(#{variable});"

April 29, 2007
5:36PM EDT
by Nic Williams

1
2
3
4
5
require 'rubygems'
require 'active_support'
require 'hpricot'
require 'open-uri'
require 'map_by_method'

April 29, 2007
3:53PM EDT
by Nic Williams

1
2
3
4
5
  def render_json(json, options={})
    callback, variable = params[:callback], params[:variable]
    response = begin
      if callback && variable
          "var #{variable} = #{json};\n#{callback}(#{variable});"

April 23, 2007
4:12AM EDT
by Nic Williams

1
svn:    '/Users/nicwilliams/Documents/rails_apps/myconfplan/vendor/svn-commit.2.tmp'

April 22, 2007
4:39PM EDT
by Nic Williams

1
2
3
                                <if_attending>
                                        <delete_button obj="#attendance" ajax="#false" label="Cancel attendance"/>
                                </if_attending>

Next page

Previous page