gem install rails
rails new my_app -T
#!/usr/bin/env python | |
#coding: utf8 | |
#################################### IMPORTS ################################### | |
# Std Libs | |
import os | |
import sys | |
import re | |
import subprocess |
SELECT id, tags->'amenity' AS value, tags FROM nodes WHERE tags ? 'amenity' ORDER BY tags->'amenity'; |
urlencode() { | |
# urlencode <string> | |
old_lc_collate=$LC_COLLATE | |
LC_COLLATE=C | |
local length="${#1}" | |
for (( i = 0; i < length; i++ )); do | |
local c="${1:$i:1}" | |
case $c in |
============================================================ | |
Benchmarking with Ruby 1.9.3 and ActiveRecord 3.2.0.beta | |
============================================================ | |
user system total real | |
============================================================ | |
RSS : 31432k (31432k) | |
Objects : 102195 (102195) | |
============================================================ | |
SINGLE-VALUE TEST |
# WAIT! Do consider that `wait` may not be needed. This article describes | |
# that reasoning. Please read it and make informed decisions. | |
# https://www.varvet.com/blog/why-wait_until-was-removed-from-capybara/ | |
# Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations? | |
describe 'Modal' do | |
should 'display login errors' do | |
visit root_path |
module OauthMocking | |
def login_with_oauth(provider = :twitter) | |
visit "/auth/#{provider}" | |
end | |
end |
require "resque" | |
require "resque_mailer" | |
require 'resque/failure' | |
require 'resque/failure/redis' | |
require 'resque/failure/multiple' | |
require "resque/failure/airbrake" | |
require 'resque/plugins/retry' | |
require "resque-retry" | |
require "resque-loner" | |
require "resque_scheduler" |
* |
create or replace function hstore_to_json(h hstore) returns text language sql | |
as $f$ | |
select '{' || array_to_string(array_agg( | |
'"' || regexp_replace(key,E'[\\"]',E'\\\&','g') || '":' || | |
case | |
when value is null then 'null' | |
when value ~ '^true|false|(-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?)$' then value | |
else '"' || regexp_replace(value,E'[\\"]',E'\\\&','g') || '"' | |
end |