Welcome! This page is using CodeRay 1.1.2.
We currently have
3049 rays
in the database.
You can add a
New Ray
or browse the posted rays by pages.
ARGF doc top |
14 lines
of
Ruby
by
Douglas Allen
|
209 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9
10
11
12
13 |
p ARGF.argv
p option = ARGV.shift
p ARGF.argv
p ARGF.all?
p ARGF.any?
$ ruby argf.rb --verbose file1 file2
["--verbose", "file1", "file2"]
"--verbose"
["file1", "file2"]
... |
|
div1 |
1 line
of
Ruby
by
div
|
4 Bytes |
Show |
Edit |
Expand |
|
sidekiq |
28 lines
of
Ruby
|
950 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9 |
class StatusNotifier
include Sidekiq::Worker
include Sidetiq::Schedulable
recurrence { minutely }
sidekiq_options retry: false
def perform options={}
Grow.not_updated.each d... |
|
controller |
48 lines
of
Ruby
|
1.13 KB |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8 |
class GrowsController < ApplicationController
before_filter :authenticate_user!
def index
@grows = current_user.grows
if @grows.size < 1
flash[:notice] = "Please add a new g... |
|
Route |
4 lines
of
C
|
156 Bytes |
Show |
Edit |
Expand |
1
2
3
4 |
Rails.application.routes.draw do
get "/current", controller: :statuses, action: :current
get "/statuses", controller: :statuses, action: :index
end
|
|
Controller |
15 lines
of
Ruby
|
315 Bytes |
Show |
Edit |
Expand |
1
2
3
4
5
6
7
8
9 |
class StatusesController < ApplicationController
def index
@statuses = Status.last_day
render json: @statuses
end
|
|
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... |
|