This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$_=$$/$$;@_=$_+$_;$-_=$_-@_ | |
$__=->_{_==[]||_==''?$.:$_+$__[_[$_..$-_]]} | |
@__=->_,&__{_==[]?[]:[__[_[$.]]]+@__[_[$_..$-_],&__]} | |
$_____=->_{@__[[*_],&->__{__[$.]}]} | |
@_____=->_{@__[[*_],&->__{__[$-_]}]} | |
$______=->_{___,______=$_____[_],@_____[_];_____=$__[___];____={};__=$.;(_=->{ | |
____[______[__]]=___[__];(__+=$_)==_____ ?____:_[]})[]} | |
@______=->_,__{_=[*_]+[*__];____=$__[_];___={};__=$.;(_____=->{ | |
___[_[__][$.]]=_[__][$_];(__+=$_)==____ ?___:_____[]})[]} | |
$_______=->_{$___=[];@___=$__[_];__=___=____=$.;$____,@____={},[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you cannot, on the ocean, sail among the swiftest fleet, | |
Rocking on the highest billows, laughing at the storms you meet, | |
You can stand among the sailors, anchored yet within the bay, | |
You can lend a hand to help them, as they launch their boats away. | |
If you are too weak to journey up the mountain steep and high, | |
You can stand within the valley, while the multitudes go by; | |
You can chant in happy measure, as they slowly pass along; | |
Though they may forget the singer, they will not forget the song. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def outer(&b) | |
foo = 1 | |
block.call | |
end | |
def inner(v) | |
puts foo + v | |
end | |
# Is there a way to make 'foo' available in the scope of `inner`? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def with_model(m, &block) | |
w = Object.new | |
w.define_singleton_method :model do | |
m | |
end | |
w.instance_eval &block | |
end | |
def property(name) | |
puts model.to_s + name.to_s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec/environment_spec_helper' | |
describe 'UsersController' do | |
describe 'GET /new' do | |
it { expect(:get => '/users/new').to be_routable } | |
it { | |
get '/users/new' | |
expect(last_response.status).to eq 200 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Game | |
def roll(*pins) | |
(@rolls ||= []).push *pins | |
end | |
def score | |
scores.inject(:+) | |
end | |
def scores |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loaded in 1.3 seconds | |
/home/polytope/.local/share/Steam/SteamApps/common/Star Ruler 2/scripts/server/empire.as: | |
Compiling void markDesignObsolete(Player&inout, const Design@, bool) | |
Error (302:5): Expression must be of boolean type | |
ERROR: Failed to build module 'empire' in manager 'server' (code -1). | |
ERROR: 'cheats': Cannot import function 'void setInstantColonize(bool)': module 'planets.SurfaceComponent' does not exist. | |
ERROR: 'empire_ai.EmpireAI': Cannot import function 'AIController@ createBasicAI()': module 'empire_ai.BasicAI' does not exist. | |
ERROR: 'orbitals': Cannot import function 'SystemDesc@ getSystem(Region@)': module 'game_start' does not exist. | |
ERROR: 'system_pathing': Cannot import function 'SystemDesc@ getSystem(uint)': module 'game_start' does not exist. | |
ERROR: 'system_pathing': Cannot import function 'SystemDesc@ getSystem(Region@)': module 'game_start' does not exist. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[-]>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]<<<<< | |
>>>>>> | |
[-]>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]<<<<< | |
>>>>>> | |
> | |
[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t1 = Time.now | |
# => 2014-10-31 13:48:12 -0400 | |
t2 = Time.at(t1.to_i) | |
# => 2014-10-31 13:48:12 -0400 | |
t1.to_a | |
# => [12, 48, 13, 31, 10, 2014, 5, 304, true, "EDT"] | |
t2.to_a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Metrics/LineLength: | |
Max: 125 |
OlderNewer