FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| > user.devices.all.uniq.class | |
| => Device::ActiveRecord_AssociationRelation | |
| # so that we can chain more AR methods | |
| > user.devices.all.uniq.limit(1) | |
| => [Device] | |
| > u.devices.uniq.class | |
| => Array | |
| # so we can only work on array: | |
| > user.devices.uniq.limit(1) |
| module Arel::Predications | |
| def has_key(right) | |
| Arel::Nodes::HasKey.new(self, quoted_node(right)) | |
| end | |
| end | |
| class Arel::Nodes::HasKey < Arel::Nodes::Binary | |
| def operator; :"?" end | |
| end |
| require "net/http" | |
| def start_server | |
| # Remove the X to enable the parameters for tuning. | |
| # These are the default values as of Ruby 2.2.0. | |
| @child = spawn(<<-EOC.split.join(" ")) | |
| XRUBY_GC_HEAP_FREE_SLOTS=4096 | |
| XRUBY_GC_HEAP_INIT_SLOTS=10000 | |
| XRUBY_GC_HEAP_GROWTH_FACTOR=1.8 | |
| XRUBY_GC_HEAP_GROWTH_MAX_SLOTS=0 |
| javascript: (function() { | |
| var root = $(document.getElementsByTagName('html')); | |
| var watchers = []; | |
| var attributes = []; | |
| var attributes_with_values = []; | |
| var elements = []; | |
| var elements_per_attr = []; | |
| var scopes = []; |
FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)