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.
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 |
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 |
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 |
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 | |
end |
BEGIN; | |
CREATE TABLE json_test ( | |
id SERIAL PRIMARY KEY, | |
label text, | |
examples text[] DEFAULT '{}'::text[] | |
); | |
INSERT INTO json_test (label,examples) VALUES ('before','{}'); | |
INSERT INTO json_test (label,examples) VALUES ('before','{"[{\"a\":1}]"}'); |
#!/bin/bash | |
# http://stackoverflow.com/questions/24634958/programmatically-detect-heroku-dyno-size-at-run-time/24634959#24634959 | |
function dyno_size() { | |
case $(ulimit -u) in | |
256) | |
echo "1X" | |
;; | |
512) | |
echo "2X" |
#!/bin/bash | |
# Update all repositories in ~/code | |
# Keep in ~/bin | |
trap "exit" INT | |
for dir in ~/code/* ; do | |
if [ -d $dir/.svn ] ; then | |
echo "Updating `basename $dir` (svn)" | |
svn update $dir | |
elif [ -d $dir/.git ] ; then | |
echo "Updating `basename $dir` (git)" |
#!/usr/bin/perl | |
# Delete inactive log files. | |
use strict; | |
use warnings; | |
my $dir = '/opt/tomcat6/logs'; | |
# Files which are open | |
my %open; |
#!/usr/bin/env ruby | |
# Take advantage of environments where Subversion server also NFS exports /home to make more efficient Subversion operations. | |
require 'net/ssh' | |
server = "admin01" | |
temporary_root = "file:///srv/svn" | |
pwd = ENV["PWD"] | |
user = ENV["USER"] | |
remote_command = "cd #{pwd} && svn " + ARGV.join(" ") | |
lock_file = ".qsvn_lock" |