NOTES
- Do not use any type of metal bowl or spoon for mixing
- Do not refrigerate
- If air forms in the bag, let it out. It is normal for batter to rise, bubble, and ferment.
require 'ap' | |
class Hash | |
def store_by_path(path, value) | |
case path | |
when String | |
if path =~ %r{/} | |
store_by_path(path.split('/'), value) | |
else | |
self[path] = value |
module Tire | |
module Results | |
class Collection | |
def __find_records_by_ids(klass, ids) | |
records = @options[:load] === true ? klass.where(klass.primary_key => ids) : klass.find(ids, @options[:load]) | |
@response['hits']['hits'].keep_if { |hit| records.map(&:id).include? hit["_id"].to_i } | |
records | |
end | |
end | |
end |
module Tire | |
module Search | |
class Search | |
alias :perform_without_fail_fast :perform | |
def perform | |
@options[:timeout] = '1900ms' | |
begin | |
Timeout::timeout 2 do | |
perform_without_fail_fast |
for
should only be used when you actually want the iteratee to be accessible after you leave the block. for
pollutes the parent scope with old iteratees. For this reason, each
should be your default.
Ever come across something funky in production and want to see it in your development environment? Use Pow? This is for you. Make a new bookmark for this location:
javascript:(function()%7Bif%20(%2Fhttp%3A.*%5C.dev%2F.test(window.location.origin))%20%7Burl%20%3D%20window.location.href.replace(%2F%5Ehttp%3A%2F%2C%20'https%3A').replace(%2F.dev%2F%2C'.com')%3Bwindow.open(url)%3B%7D%20else%20%7Burl%20%3D%20window.location.href.replace(%2F%5Ehttps%3A%2F%2C%20'http%3A').replace(%2F.com%2F%2C'.dev')%3B%3Bwindow.open(url)%3B%7D%7D)()
If you want to edit this, first copy and paste the JavaScript below into a bookmarklet creator. I used http://mrcoles.com/bookmarklet/ but others might be nice, too.
// Generate a set of 128x128 png icons for notifications from our color palette. | |
// Order must match .status-box:nth-of-type() declarations. | |
var color_data = { | |
"#1564f9": "UVZPl4Z7ha", | |
"#3fc41b": "U/xButvkTR", | |
"#fa8e1f": "X6jh83IXPs", | |
"#4ca8ea": "VMqOr4+3T5", | |
"#f71347": "X3E0eeps0u", | |
"#fcc124": "X8wST1RrWw" | |
}; |
require 'rubygems' | |
require 'irb/completion' | |
require 'irb/ext/save-history' | |
# interactive editor: use vim from within irb | |
#begin | |
# require 'interactive_editor' | |
#rescue LoadError => err | |
# warn "Couldn't load interactive_editor: #{err}" | |
#end |
#!/usr/bin/env ruby | |
samples = [] | |
STDIN.lines.each do |line| | |
next if line =~ /^stty/ | |
next if line =~ /^Running/ | |
if line =~ /real.*user.*sys/ | |
real,_,user,_,sys = line.strip.split(/\s+/) | |
samples << [Float(real),Float(user),Float(sys)] |
{ | |
"caret_style": "wide", | |
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow.tmTheme", | |
"detect_indentation": true, | |
"draw_indent_guides": true, | |
"draw_white_space": "all", | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
"*.pyc", |