I hereby claim:
- I am nz on github.
- I am nz (https://keybase.io/nz) on keybase.
- I have a public key whose fingerprint is 9B6A A415 178D EE9F A265 B3E9 DF54 6078 26E3 B167
To claim this, I am signing this object:
module Downcaseable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def downcase_field(*names) | |
Array(names).flatten.each do | |
class_eval %Q( | |
def #{name}_eval | |
send(:#{name}).try(:downcase) | |
end | |
) |
I hereby claim:
To claim this, I am signing this object:
if defined?(Rails) && Rails.env | |
reset = "\e[0m" | |
color = case Rails.env | |
when 'development', 'test' | |
"\e[36m" # cyan | |
else | |
"\e[31m" # magenta | |
end |
ES_URL = urlparse(os.environ.get('BONSAI_URL') or 'http://127.0.0.1:9200/') | |
HAYSTACK_CONNECTIONS = { | |
'default': { | |
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', | |
'URL': ES_URL.scheme + '://' + ES_URL.hostname + ':80', | |
'INDEX_NAME': 'haystack', | |
}, | |
} |
function rebase { | |
if [[ $1 == "" ]]; then master='master'; else master=$1; fi | |
branch=`git branch | grep \* | awk '{print $2}'` && | |
git checkout $master && git pull && git rebase $master $branch | |
} | |
function push { | |
if [[ $1 == "" ]]; then master='master'; else master=$1; fi | |
branch=`git branch | grep \* | awk '{print $2}'` && | |
rebase $master && git checkout $master && git merge $branch && git push && |
# 0. Do all your work in a local branch, preferably named loosely for the feature you're working on. | |
git checkout -b work | |
# 1. Make sure all your changes are committed. | |
git commit -m "changes to a local branch" | |
# 2. Update the master branch, pulling down the latest code from the rest of the team | |
git checkout master | |
git pull | |
require 'autotest/redgreen' | |
Autotest.send(:alias_method, :real_make_test_cmd, :make_test_cmd) | |
Autotest.send(:define_method, :make_test_cmd) do |*args| | |
real_make_test_cmd(*args).sub('test/unit', %[rubygems -e "require 'redgreen'"]) | |
end | |
Autotest.add_hook :initialize do |autotest| | |
autotest.add_exception(/^\.\/vendor/) | |
autotest.add_exception(/\.svn/) |
// The search query for this was my address here in Bremerton. This is the result. | |
{"places": | |
{"place": | |
[{ "woeid":2368481, | |
"placeTypeName":"Town", | |
"placeTypeName attrs":{"code":7}, | |
"name":"Bremerton", | |
"country":"United States", | |
"country attrs":{"type":"Country","code":"US"}, | |
"admin1":"Washington", |
class GatheringPlan < ActiveRecord::Base | |
belongs_to :roov | |
belongs_to :gathering_idea | |
has_many :participations, :class_name => "GatheringPlanParticipation" | |
has_many :participants, :through => :participations, :source => :user | |
has_many :votes, :class_name => "GatheringPlanVote" | |
has_many :suggestions, :through => :votes, :source => :suggestion | |
end |
[4294967295,4294967295].to_yaml | |
#=> "--- \n- 4294967295\n- 4294967295\n" | |
[4294967295,4294967295].to_yaml.size | |
#=> 31 | |
[4294967295,4294967295].to_json | |
#=> "[4294967295,4294967295]" | |
[4294967295,4294967295].to_json.size | |
#=> 23 |