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 68, 10 entries

Controller 15 lines of Ruby 315 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
class StatusesController < ApplicationController
  # GET /statuses
  # GET /statuses.json
  def index
    @statuses = Status.last_day
    render json: @statuses
  end

  # GET /statuses/cur...
Sensor 45 lines of Ruby 1.21 KB Show Edit Expand
1
2
3
4
5
6
7
8
class Status < ActiveRecord::Base

  validates_presence_of :temperature
  validates_presence_of :humidity

  scope :last_day, ->(){ where(created_at: (Time.now - 24.hours)..Time.now) }

  def...
sdcvsdavdasvasdvadvas 1 line of SQL by sdavsadvasdv 48 Bytes Show Edit Expand
1
sdvsdsadvasdvasdvasdvsadvsadvsadvsadvsadvsadvasv
Install Wine on Linux 10 lines of HTML by Linux-Videos.com 168 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
9
10
To Install Wine on Linux


sudo apt-get remove –purge wine

Add the repository and Install Wine

sudo apt-get update

sudo apt-get install wine1.7 winetricks
test 11 lines of diff by sam 315 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
@@ -1,8 +1,6 @@
-t
-s
-dfest
+test
 <!-- v2
 If this page requires content, please be sure to include the "page_required_header" 
 and "page_required_footer" tags inside curly brace percenta...
test 11 lines of C by sam 315 Bytes Show Edit Expand
1
2
3
4
5
6
7
8
@@ -1,8 +1,6 @@
-t
-s
-dfest
+test
 <!-- v2
 If this page requires content, please be sure to include the "page_required_header" 
 and "page_required_footer" tags inside curly brace percenta...
dsa 6 lines of PHP 200 Bytes Show Edit Expand
1
2
3
4
5
6
describe 'permit some elements from params and miss others' do
  before do
    @params = ActionController::Parameters.new @hash
  end
  it 'should log non-permitted attributes' do
    ActiveSu...
Code 3 lines of JavaScript 71 Bytes Show Edit Expand
1
2
3
function transform(unit){ 
var output = unit.output; 
return output;}
test 12 lines of Ruby by test 401 Bytes Show Edit Expand
1
2
3
4
5
6
describe 'permit some elements from params and miss others' do
  before do
    @params = ActionController::Parameters.new @hash
  end
  it 'should log non-permitted attributes' do
    ActiveSu...
sf 21 lines of Python by vdfb 639 Bytes Show Edit Expand
1
2
3
4
5
6
7
kmer_size = 12
def split_dna(dna, kmer_size):
    kmers = []
    for start in range(0,len(dna)-(kmer_size-1),1):
        kmer = dna[start:start+kmer_size]
        kmers.append(kmer)
    retur...

Page 68, 10 entries