Welcome! This page is using CodeRay 1.1.1.

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

Page 263, 10 entries

Collect field names in spreadsheet 27 lines of Ruby by Alex 638 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
require 'win32ole'

DATAHOME = 'D:\My Documents\Projects\ruby\pca\08_shipping_rec'

xl = WIN32OLE.new('excel.application')
all_fields = []

Dir.foreach(DATAHOME) do |f|
   fn_xls = File.joi...
Guess what this is 29 lines of Ruby by Jay 552 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
12
module CodeRay
  
  # = Duo
  #
  # $Id: scanner.rb 123 2006-03-21 14:46:34Z murphy $
  #
  # TODO: Doc.
  class Duo

    attr_accessor :scanner, :encoder

    def initialize lang, forma...
fsadsfa 1 line of Ruby by asdfsadfsf 12 Bytes Show Edit Expand
1
puts 'hello'
A helper 7 lines of Ruby by David 138 Bytes Show Edit Expand
1
2
3
4
5
6
7
  def title(text, &block)
    if block_given?
      content_for :title, &block
    else
      content_for :title, text
    end
  end
test 9 lines of Ruby 334 Bytes Show Edit Expand
1
2
3
4
5
6
7
    mab.html do
      head { title "Polish" }
      body do
        if errors_file[0]
          h1(:style => "font-family: " +
            "'Lucida Grande',Verdana,Helvetica,sans-serif") do
 ...
MarcRic's test 13 lines of Ruby by Marcos Ricardo 598 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
class MyOwnRubyClass
  def my_own_ruby_method(my_parameter, your_parameter)
    puts Time.now
    current_month = Time.now.month
    yield(my_parameter,your_parameter,current_month )
  end
end

my_...
gtkdebug 98 lines of Ruby 2.9 KB Show Edit Expand
1
2
3
4
5
6
7
8
9
10
begin
  require 'gtksourceview'
rescue LoadError
else
  module Kernel
    alias __raise raise
    def raise(*args)
      __raise(*args)
    rescue Exception => exc
      exc.backtrace.shif...
fuck 6 lines of Ruby 122 Bytes Show Edit Expand
1
2
3
4
5
6
class Fuck << self
  def fuck(off, &block)
    @fuck = { :fuck => %r{fuck}, :fuck2 => (0...23) }
    @fuck.
  end
end
Test 102 lines of Ruby 3.5 KB Show Edit Expand
1
2
3
4
5
6
7
8
9
  class Chars
    
    attr_reader :string # The contained string
    alias_method :to_s, :string
    
    include Comparable
    
    # The magic method to make String and Chars comparable
...
Array to String with commas and "and" before the last elemen 3 lines of Ruby by Hallison Batista 170 Bytes Show Edit Expand
1
2
3
array = ["one","two","three","four","five"]
join  = array[0..-2].join(', ') + " and " + array[-1].to_s + " are numbers that belongs to the array of integers."
puts join

Page 263, 10 entries