BitOfUniverse
Follow
Solidity, JS/TS, Web3 enthusiast.
HFT hobbyist trader.
- Finland, Helsinki
-
02:58
(UTC +02:00) - https://stackoverflow.com/users/172159/bitofuniverse
- in/alexey-nikolaev-b979243b
Pinned Loading
-
-
Ruby IFFE with method definition
Ruby IFFE with method definition 1send def execute_right_now
2puts "That's nice!"
3end
-
Consistent splitting using hashing a...
Consistent splitting using hashing and modulo 1require 'zlib'
23six_items = ["item_1", "item_2", "item_3", "item_4", "item_5", "item_6"]
4ten_items = ["item_1", "item_2", "item_3", "item_4", "item_5", "item_6", "item_7", "item_8", "item_9", "item_10"]
5 -
Ruby IFFE usage in Rails
Ruby IFFE usage in Rails 1class RailsController
2helper_method def current_user
3User.current
4end
5end
-
Ruby infinite lambda self invocation
Ruby infinite lambda self invocation 1go_deeper.call.call.call.call.call.call.call.call
2# You can try to implement it yourself. Your code will look like this:
34(go_deeper = -> { puts "deeper"; go_deeper }).call.call.call.call.call
-
Ruby infinitely nested hash
Ruby infinitely nested hash 1hash = Hash.new {|h, k| h[k] = Hash.new(&h.default_proc) }
2hash[:this][:is][:really] = 'Amazing!'
3hash
45=> {:this=>{:is=>{:really=>"Amazing!"}}}
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.