/explore

Click through on any links that interest you or select the planets on the right to continue exploring the Outer Web.
You are here

newvick.com
| | nithinbekal.com

Nithin Bekal's blog about programming - Ruby, Rails, Vim, Elixir.
9.8 parsecs

Travel
| |
| | ngauthier.com

[AI summary] A guide explaining how to use presenters in Ruby on Rails to transform ActiveRecord models into specific JSON formats.
9.2 parsecs

Travel
| |
| | tenderlovemaking.com

TL;DR: Rack API is poor when you consider streaming response bodies. class FooApplication class ErbPage def to_a head = "the head tag" sleep(2) body = "the body tag" sleep(2) [head, body] end end def call(env) [200, {}, ErbPage.new.to_a] end end class FakeRack def serve(application) status, headers, body = application.call({}) p :status => status p :headers => headers body.each do |string| p string end body.close if body.respond_to?(:close) end end app = FooApplication.new rack = FakeRack.new rack.serve app $ time ruby foo.rb {:status=>200} {:headers=>{}} "the head tag" "the body tag" real 0m4.008s user 0m0.003s sys 0m0.003s class ResponseTimer def initialize(app) @app = app end def call(env) now = Time.now status, headers, body = @app.call(env) headers['X-R...
9.4 parsecs

Travel
| |
| | scruss.com

Updated: Thanks to Ben, who noticed the Fritzing diagrams had the sensors the wrong way round. Fixed now... Hidden away in the Pico MicroPython guide is a hint that there may be more modules in...
56.5 parsecs

Travel
|