My Recent Pastes (196390 and counting)

All Pasties (129 and counting)

Pages: 1 ... 6933 6934 6935 6936 6937 ... 7856

Below are summaries of the most recent pasties.

December 06, 2006
1:53PM EDT

1
2
3
4
# have DataRunner return the results, or false/nil if blank

runner = DataRunner.new()
final_results = runner.run { ... } && runner.run { .. }

December 06, 2006
1:51PM EDT

1
2
3
4
5
class Development < ActiveRecord::Base
config = YAML.load_file(File.join(File.dirname(__FILE__), 'config.yml'))
Development.establish_connection(config['development'])
end

December 06, 2006
1:48PM EDT

1
2
3
4
5
class EmptyDataBreaker
  def run(*args)
    yield(*args) || false
  end
end

December 06, 2006
1:46PM EDT
by craig.mackenzie

1
2
3
4
5
  def browse
    if params[:year] and params[:month] and params[:day]
      browse_date = Date.new(params[:year], params[:month], params[:day])
    else 
      browse_date = Date.today

December 06, 2006
1:44PM EDT

1
2
3
4
5
  # A pattern extraction
  class EmptyDataBreaker
    # Eklas should be the kind of exception you want to raise
    def initialize(eklas)
      @eklas = eklas

December 06, 2006
1:41PM EDT
by Alastair Moore

1
2
3
4
5
export TM_YEAR=`date +%Y`
export TM_DATE=`date +%Y-%m-%d`
export TM_USERNAME=`niutil -readprop / /users/\$USER realname`
TM_HEADER="$TM_NEW_FILE_BASENAME.css"

December 06, 2006
1:40PM EDT
by Alastair Moore

1
fi

December 06, 2006
1:33PM EDT
by njero

1
2
3
4
5
I am moving http://compliancestudio.com/sample to ruby. The workflow is: 
(1) user vists page, 
(2) clicks calc 
(3) calc calls a local web service to pass on to the 
  main remote webservice and get back the payment 

December 06, 2006
1:19PM EDT

1
2
3
4
5
## VIEW
<div id="toggle_hidden">
  <% form_for(:prospect, :url => { :action => 'index' }, :html => { :method => :get }) do |f| %>

    <table width="100%">

December 06, 2006
1:18PM EDT

1
2
3
4
5
#include "stdafx.h"
#include "Form1.h"

using namespace hmwk8;

December 06, 2006
1:18PM EDT

1
2
3
4
5
# try this

  def index
    ps = params[:prospect] || {}
    cond = EZ::Where::Condition.new :prospects do

December 06, 2006
1:17PM EDT

1
2
3
4
5
int main(array<System::String ^> ^args)
{
        // Enabling Windows XP visual effects before any controls are created
        Application::EnableVisualStyles();
        Application::SetCompatibleTextRenderingDefault(false); 

December 06, 2006
1:15PM EDT

1
2
3
4
5
########### VIEW
<div id="toggle_hidden">
  <% form_for(:prospect, :url => { :action => 'index' }, :html => { :method => :get }) do |f| %>

    <table width="100%">

December 06, 2006
1:14PM EDT
by craig.mackenzie

1
link_to d.mday, {:controller => "events", :action => "browse", :year => d.year, :month => d.month, :day => d.day

December 06, 2006
1:09PM EDT

1
2
3
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]

December 06, 2006
1:05PM EDT
by Paul_S

1
2
3
4
5
$ ./script/console
Loading development environment.
>> helper.human_size(5000000000)
=> "4.7 GB"
>> helper.link_to 'test', :action => 'test'

December 06, 2006
1:04PM EDT
by harrisj

1
2
3
4
5
class Array
        def to_h
                h = {}
                each do |x| 
                  arr = yield x

December 06, 2006
1:00PM EDT

1
2
3
4
5
   Rung 45:      Filter pH (132 -> 138) (Pool 1)                                        

            B:64   O:6                  W:1587 K:0                                F:0    
     ---------] [---[OST]-----------+-----[W]----[=]-----+--------------------+----(DSP)-
                                    |                    |                    |          

December 06, 2006
12:51PM EDT

1
2
3
4
5
  def index
    cond = EZ::Where::Condition.new :prospects do
      firstname =~ "%#{params[:firstname]}%"
      lastname =~ "%#{params[:lastname]}%"
      city =~ "%#{params[:city]}%"

December 06, 2006
12:39PM EDT
by bryan

1
2
3
4
5
AT&T: 
  distance: 0
  products: 
    - 
      desc: 3M x 3M

December 06, 2006
12:38PM EDT
by bryan

1
2
3
4
5
AT&T: 
  distance: 0
  products: 
    - 
      desc: 3M x 3M

December 06, 2006
12:18PM EDT

1
2
3
4
5
## Run this in ./script/console

require 'pp'

dates = Event.find(:all).map { |event| (event.starts_at..event.ends_at) }

December 06, 2006
12:18PM EDT

1
2
3
4
5
## Run this in ./script/console
require 'pp'

dates = Event.find(:all).map { |event| (event.starts_at..event.ends_at) }
pp dates

December 06, 2006
12:10PM EDT

1
@dates = Event.find(:all).map { |event| (event.starts_at..event.ends_at) }

December 06, 2006
12:05PM EDT
by craig.mackenzie

1
@dates = Event.find_all.collect {|r| r.starts_at.to_date.upto(r.ends_at.to_date) do |d| return d end}

Next page

Previous page