Welcome! This page is using CodeRay 1.1.2.

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

Page 2, 10 entries

a 13 lines of Ruby 200 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
12
13
class BottleNumber
  def self.for(number)
    case number
    when 0
      BottleNumber0
    when 1
      BottleNumber1
    when 6
      BottleNumber6
    end.new(number)
  end
  # ...
end
a 21 lines of Ruby 276 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class BottleNumber
  # ...
  def container
    if number == 1
      "bottle"
    else
      "bottles"
    end
  end
  # ...
end

class BottleNumber1 < BottleNumber
  def container
   ...
a 21 lines of Ruby 280 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class BottleNumber
  # ...
  def quantity
    if number == 0
      "no more"
    else
      number.to_s
    end
  end
  # ...
end

class BottleNumber0 < BottleNumber
  def quantity
  ...
a 14 lines of Ruby 391 Bytes Show Edit Expand
1
2
3
4
5
6
class Bottles
  # ...
  def verse(number)
    bottle_number      = BottleNumber.new(number)
    next_bottle_number = BottleNumber.new(bottle_number.successor)
    "#{bottle_number} ".capitaliz...
json 4 lines of JSON by adad 67 Bytes Show Edit Expand
1
2
3
4
"dependencies": {
 "react": "^16.0.0",
 "react-rom": "^16.0.0"
}
sddssd 7 lines of Groovy (beta) 109 Bytes Show Edit Expand
1
2
3
4
5
6
7
@RestController
class Hello {
    @GetMapping("/")
    String home() {
        "Hello Postman!"
    }
}
Typescript 37 lines of JavaScript 676 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
11
import * as React from 'react';

import Count from './Count';

interface Props {}

interface State {
  count: number;
};

export default class Counter extends React.Component<Props, State...
aaa 6 lines of JSON 97 Bytes Show Edit Expand
1
2
3
4
5
6


{"pill/type":"term",
 "pill/query":"term key",
 "pill/mode":"term mode key (optional)"}

Test Java 149 lines of Java 3.55 KB Show Edit Expand
1
2
3
4
5
6
7
8
//Mike Scott
//examples of array manipulations

public class ArrayExamples
{  public static void main(String[] args)
  {  int[] list = {1, 2, 3, 4, 1, 2, 3};
    findAndPrintPairs(list, 5);
    bub...
azeaze 35 lines of PHP 1.62 KB Show Edit Expand
1
2
3
    $parameters:=New collection(\
    New object("type";"bool";"name";"testb";"default";True);\
    New object("type";"integer";"name";"rate";"label";"Your rating";"format";"rating";"default";5;"min";1...

Page 2, 10 entries