Welcome! This page is using CodeRay 1.1.2.

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

Page 296, 10 entries

yahoo 5 lines of Ruby by me 797 Bytes Show Edit Expand
1
2
    class Foo                                                                                                                                                                                     
 ...
Named Scope Example with Lambda and Group By Having 5 lines of Ruby by Tony Perrie 368 Bytes Show Edit Expand
1
2
3
4
  named_scope :linked_to, 
  lambda { |ovs| { :select => "domain_objects.*, count(links.from_id) AS object_count", 
                   :conditions => [ "links.object_value_id IN (?)", ovs ], 
  ...
http://judofyr.net/posts/morse.html 55 lines of Ruby by Magus Holm 2.22 KB Show Edit Expand
1
2
3
4
5
module                    Morse

 A,B,C=proc{M.tr(' ','').gsub(/#{$/}+/,$/).split($/).map{|x|
x[/(.)(.+)(.).*\1\2\3/,2].to_i(16)}},proc{|c|A[][c-65].to_s(2
    )[1..-1].tr('10','-.')},proc{|m|(...
groups test 8 lines of Ruby by anon 120 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
class GroupsController < ApplicationController
  helper Ziya::Helper
  
  def index
    @group = nil;

   end
end
Random Ruby Class 8 lines of Ruby 256 Bytes Show Edit Expand
1
2
3
4
class ApplicationController < ActionController::Base
  # Pick a unique cookie name to distinguish our session data from others'
  session :session_key => '_tags2_session_id'
  require 'string_mi...
test 90 lines of C by test 1.34 KB Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
#include <stdlib.h>

typedef struct l1 {
  struct l1* next;
  int key;
} l1;

l1* head = NULL;

l1* insert_head(int key) {
  l1* p;
  p = (l1*) malloc(sizeof(struct l...
1 upto 10 13 lines of Ruby by Noone 153 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
12
13
int main() {
   int i=1;
   for (;i<10;i++) {
      printf("%d",i);
   }
  return 0;
}

# In Ruby

1.upto (10) do |x|
  printf "%2d\n", x
end
Test 2 lines of Ruby 404 Bytes Show Edit Expand
1
2
def e(x) return 34.chr+x+34.chr end;def q(a,b,c) print b+10.chr+'main=q '+e(b)+' '+e(c)+' '+e(a)+' '+10.chr end
q("def e(x) return 34.chr+x+34.chr end;def q(a,b,c) print b+10.chr+'main=q '+e(b)+' ...
rangotis 1 line of ERb by rangotis 13 Bytes Show Edit Expand
1
<%= "du[a" %>
nice 4 lines of Ruby by Amiel 80 Bytes Show Edit Expand
1
2
3
4
def blah
  ruby_code = %(weee " quote's " )
  self.is_probably_ruby_code?
end

Page 296, 10 entries