My Recent Pastes (264510 and counting)

All Pasties (over 264,510 and counting)

Pages: 1 12267 12269 12271 13226

Below are summaries of the most recent pasties.

November 07, 2006
2:55PM EDT

1
2
3
4
5
>> a = [[1,2,3]].to_table(%w[a b c])
=> #<Ruport::Data::Table:0xb79cbe74 @data=[#<Ruport::Data::Record:0xb79cbcf8 @data=[1, 2, 3], @attributes=["a", "b", "c"]>], @column_names=["a", "b", "c"]>
>> a.tags = %w[a b c]
=> ["a", "b", "c"]
>> a.to_a.to_table(%w[a b c]).tags

November 07, 2006
2:53PM EDT

1
2
3
4
5
##
## torrentonrails.rb -- TorrentOnRails BitTorrent server
##

require 'rubygems'

November 07, 2006
2:45PM EDT
by seancribbs

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

class EventTest < Test::Unit::TestCase
  fixtures :events

November 07, 2006
2:44PM EDT

1
2
3
4
5
test_sort_rows_by(TestTable) [./test/test_table.rb:342]:
<#<Ruport::Data::Table:0xb7b9b45c
 @column_names=["a", "b", "c"],
 @data=
  [#<Ruport::Data::Record:0xb7b9686c

November 07, 2006
2:41PM EDT
by slowsilver

1
2
3
4
5
#SHIFT uses the TM_REMOTE_URL variable as Base URL for this command.
#DEFAULT is TM_LOCAL_URL and fallback is www.example.com
#You have to set up the two Shell variables $TM_REMOTE_URL and $TM_LOCAL_URL, if you want the SHIFT modifier behavior to work.
#If those are not set up in your prefs, then the base URL will fall back to example.com as a tab stop variable, where you can then insert an alternate base URL.
#OPTION modifier is used to wrap the hardcoded thumbnail img with a link to the full size version, provided, that such an image exists in the target Folder.Also, you have to drag the thumbnail img in this case.

November 07, 2006
2:40PM EDT
by slowsilver

1
2
3
4
5
#SHIFT uses the TM_REMOTE_URL variable as Base URL for this command.
#DEFAULT is TM_LOCAL_URL and fallback is www.example.com
#You have to set up the two Shell variables $TM_REMOTE_URL and $TM_LOCAL_URL, if you want the SHIFT modifier behavior to work.
#If those are not set up in your prefs, then the base URL will fall back to example.com as a tab stop variable, where you can then insert an alternate base URL.
#OPTION modifier is used to wrap the hardcoded thumbnail img with a link to the full size version, provided, that such an image exists in the target Folder.Also, you have to drag the thumbnail img in this case.

November 07, 2006
2:32PM EDT

1
2
3
4
5
  def self.get_option(option, index=nil)
    case option
      when :priority_level
        x = [[_('Low'), 0], [_('Medium'), 1], [_('High'), 2]]
        index ? x.rassoc(index).first : x

November 07, 2006
2:27PM EDT
by harrisj

1
2
3
4
5
Jacob-Harris-Mac:~/projects/rubinius jacobharris$ rake shotgun
(in /Users/jacobharris/projects/rubinius)
bin/rcc:7: undefined method `index' for nil:NilClass (NoMethodError)
cd lib; make librubinius.a
gcc -c -o array.o array.c -Wall -g -ggdb3 -I../../include -iquote . `pkg-config glib-2.0 --cflags`

November 07, 2006
2:20PM EDT

1
2
3
4
5
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'

ActiveRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml"))
ActiveRecord::Base.establish_connection

November 07, 2006
2:19PM EDT

1
khlhklh

November 07, 2006
2:12PM EDT

1
bacon

November 07, 2006
2:00PM EDT

1
2
3
4
5
  def popular
    @posts = Post.find_by_rating(5)
  end


November 07, 2006
1:57PM EDT
by ghastner

1
2
3
4
5
  def create
    bad_zips = []
    @zips = params[:zip][:zip].split(/\s/).select { |z| !z.empty? }
    @zips.each do |zip|
      params[:zip][:zip] = zip

November 07, 2006
1:50PM EDT
by John Bachir

1
2
3
4
5
require 'open-uri'

def findword(word)
  open( "http://api.rubyonrails.org/fr_method_index.html" ) do |document|
    document.each_line do |line|

November 07, 2006
1:43PM EDT
by johnm1019

1
2
3
4
<%= select :object => @question_opts['attribute'], 
               :choices => options_for_select(@question_opts['fields'].keys),
               :options => {:prompt => "Please choose..."}
               %>

November 07, 2006
1:31PM EDT
by kastner

1
2
3
4
5
  def create
    bad_zips = []
    all_zips = params[:zip][:zip]
    @zips = params[:zip][:zip].split(/\s/)
    

November 07, 2006
1:30PM EDT

1
2
3
4
5
sort_rows_by(options={}, &block)

Returns a sorted table. If options has a key :columns the block is ignored and the table is sorted by the named columns. Other options are passed to to_table

Example:

November 07, 2006
1:30PM EDT

1
2
3
4
5
sort_rows_by(options={}, &block)

Returns a sorted table. If options has a key :columns the block is ignored and the table is sorted by the named columns. Other options are passed to to_table

Example:

November 07, 2006
1:29PM EDT

1
2
3
4
5
sort_rows_by(options={}, &block)

Returns a sorted table. If options has a key :columns the block is ignored and the table is sorted by the named columns. Other options are passed to to_table

Example:

November 07, 2006
1:27PM EDT

1
2
3
4
5
OSX atma ~ $ curl -I http://atmat.static.otenet.gr/files/sshot1.png
HTTP/1.1 200 OK
Content-Type: image/png
ETag: "-1031530046"
Accept-Ranges: bytes

Next page

Previous page