Welcome! This page is using CodeRay 1.1.2.

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

Page 126, 10 entries

xpto 42 lines of Ruby by xpto 1.45 KB Show Edit Expand
1
2
3
4
5
6

# Let's build our own survey
my_survey = Survey::Survey.new(:name => "Star Wars Quiz", :attempts_number => 4, :active => true)

# Let's add some questions and options
question_1 = Survey::Que...
c++ 3 lines of C++ 109 Bytes Show Edit Expand
1
2
3
    QString messageText = tr("Do you really want   ");
    messageText += mymother.first;
    messageText += "?";
Java Rule 6 lines of Java 128 Bytes Show Edit Expand
1
2
3
4
5
6
rule "My Rule"
  when <LHS>
    Person(name == "John") <CEs>
  then <RHS>
    System.out.println("Hi John!"); <Actions>
end
Gosu boilerplate 17 lines of Ruby 233 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'gosu'

class GameWindow < Gosu::Window
  def initialize
    super 640, 480, false
    self.caption = "Gosu Tutorial Game"
  end

  def update
  end

  def draw
  end
end

wi...
Diff test 10 lines of diff by Jaja 198 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
diff --git a/Gemfile b/Gemfile
index dc05d66..cb6d2f7 100644
--- a/Gemfile
+++ b/Gemfile
@@ -7,6 +7,7 @@ gem 'rails', '3.2.12'
 
 gem 'pg'
-gem 'coderay'
+gem 'coderay_bash'
 gem 'devise'
Baz 4 lines of Python by Boo 114 Bytes Show Edit Expand
1
2
3
4
Foo:
  # Bu/Bd Value
  bud_value = if bud_calc>0 then MIN(bud_calc, max_buyup)*bup_mult else bud_calc*bdn_mult

lala 12 lines of JavaScript by lala 510 Bytes Show Edit Expand
1
2
3
4
5
6
7
    <script type="text/javascript">

          var _gaq = _gaq || [];
          _gaq.push(['_setAccount', 'UA-']);

          (function() {
            var ga = document.createElement('script...
Code Test 2 lines of C++ by demo 28 Bytes Show Edit Expand
1
2

int a;/*demo*/int b;//demo
Test xml 5 lines of XML by j 182 Bytes Show Edit Expand
1
2
3
4
5
<cm-mapping package="zbs.pln.postpaid.switcher">
    <class name="InquiryRequestAdditional">
      <field name="switcherId" type="string" length="7" />
    </class>
</cm-mapping>
test 39 lines of C++ 1.21 KB Show Edit Expand
1
2
3
4
5
6
7
...
        int portd, res;
        struct termios options, oldtio;
        char buf[BUFFER_SIZE];

        portd = open(PORTDEVICE, O_RDWR | O_NOCTTY | O_NDELAY);
        fcntl(portd, F_SETF...

Page 126, 10 entries