Welcome! This page is using CodeRay 1.1.2.

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

Page 254, 10 entries

Ruby on Rails Model 19 lines of Ruby by Padde 749 Bytes Show Edit Expand
1
2
3
4
class Group < ActiveRecord::Base
  has_many :memberships, :dependent => :destroy
  has_many :people, :through => :memberships
  accepts_nested_attributes_for :memberships, :allow_destroy => true...
diff 33 lines of diff 1.19 KB Show Edit Expand
1
2
3
4
5
6
7
--- git.rb  2010-07-16 17:56:36.000000000 -0300
+++ xpto.rb  2010-07-16 17:55:55.000000000 -0300
@@ -11,23 +11,22 @@
 
 branch = {}
 
-branch[:mirror_cvs]         = "#{repositorios_git_path}/de...
Ruby is sexy 1 line of Ruby 31 Bytes Show Edit Expand
1
5.times { puts "Ruby is sexy" }
Neftemer getDataNoEx function 17 lines of Java 604 Bytes Show Edit Expand
1
2
3
4
5
6
    public <T> T getDataNoEx(String key) {
        T ret = null;
        try {
            ret = (T) this.getData(key, metainfo.get(key));
            return ret;
        } catch (UnknownObjec...
flv2mp3 64 lines of C by Oliver Heins 2.35 KB Show Edit Expand
1
2
3
4
5
6
7
8
#!/bin/bash
#
# flv2mp3.sh -- converts flv and mp4 to mp3.
#
# Copyright (c) 2010 Oliver Heins <heins@sopos.org>
# 
# Permission is hereby granted, free of charge, to any person
# obtaining ...
C# Class 14 lines of Java 566 Bytes Show Edit Expand
1
2
3
4
    public static class StringUtil
    {
        private static readonly Regex HtmlTag = new Regex("</?.+?>", RegexOptions.Compiled);
        public static string StripHtml(this string inputStri...
test 1 line of Plain text 104 Bytes Show Edit Expand
1
This installation of RMagick was configured with ImageMagick 6.5.4 but ImageMagick 6.5.8-10 is in use.
French ordinals 6 lines of Ruby by murphy 119 Bytes Show Edit Expand
1
2
3
4
5
6
# lib/locales/fr.rb
{
  :fr => {
    :ordinal => proc { |number| "#{number}#{number == 1 ? 'er/re' : 'e'}" }
  }
}
123 6 lines of SQL 346 Bytes Show Edit Expand
1
2
3
4
select A.column_name å­æ®µå,A.data_type æ°æ®ç±»åž,A.data_length é¿, 
A.data_precision æ´æ°ä½, A.Data_Scale 小æ°ä½, 
A.nullable åè®¸ç©ºå¼,A.Data_default 缺省å¼, 
B.comments å¤...
Python 10 lines of Python by Honza 201 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
import datetime

class SomeClass:

    def __init__(self, param):
        self.parameters = param
        self.now = datetime.datetime.utcnow()

    def getAuthor(self):
        return 'Ho...

Page 254, 10 entries