Welcome! This page is using CodeRay 1.1.1.

We currently have 2670 rays in the database.
You can add a New Ray or browse the posted rays by pages.

Page 265, 10 entries

OscarScraper 19 lines of Ruby by Juan Villa 591 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
require 'oscar_scraper'

# Initialize Oscar Scraper
scraper = OscarScraper.new

# Log in to oscar (Replace sid and pin with your sid and pin)
logged_in = scraper.login :sid => "90XXXXXXX",
 ...
just a test 11 lines of C 514 Bytes Show Edit Expand
1
2
3
  def create
    @cookbook = Cookbook.new(params[:cookbook])
    @cookbook.code_html = CodeRay.scan(@cookbook.code.gsub(/^\s+\n/, ''), @cookbook.category).div(:line_numbers => :list, :css => :sty...
ActiveRecord sample (Ruby) 26 lines of Ruby by Teggy 980 Bytes Show Edit Expand
1
2
3
4
5
6
7
require 'rubygems'
require 'activerecord'

require 'pp'

ActiveRecord::Base.establish_connection :adapter           => 'postgresql', 
                                        :database        ...
test 4 lines of Plain text 26 Bytes Show Edit Expand
1
2
3
4
hello
ca marche

argh
Ruby 17 lines of Ruby 643 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
class ChangeAffiliation < Test::Unit::TestCase   
  
  def setup
    $browser = Watir::IE.new
    $browser.maximize()
    $browser.set_fast_speed
    load 'LoginControl.rb'
    @outputfile =...
Rails Testing 7 lines of Ruby by Juan 110 Bytes Show Edit Expand
1
2
3
4
5
6
7
class A < ActiveRecord::Base
  acts_as_cool

  def to_param
    "#{self.id}-#{self.permalink}"
  end
end
multiline comments 24 lines of C by Avi 558 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
CDcmImage* misc::RetrieveAndMaybeCreateDcmImage(
  CDcmSeries* a_pSeries,
  const std::string& a_sImgUID,
  size_t a_nImageIdx
)
{
  const bool bMakeItFail = false; //true;
  if ( bMakeItFail)
  ...
C++ Classes 40 lines of C by Me 846 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
12
13
class valor_aptidao
{
  public:
  int i;
  float aptidao;

  valor_aptidao(std::pair<int,float>p) 
    { i = p.first; aptidao = p.second; }
};


bool vcompare (valor_aptidao lhs, 
    valor_apt...
FooBar 7 lines of Ruby by dirtyhand 299 Bytes Show Edit Expand
1
2
3
4
5
def to_link(member_id='default-member')
    # UGLY - change later
    doc = Hpricot(code)
    link = doc.search('a').first[:href]
    link = " href=\"#{link}#{retailer.broker.member_id_template...
km 4 lines of Ruby 28 Bytes Show Edit Expand
1
2
3
4
class Foo
def bar
end
end

Page 265, 10 entries