I hereby claim:
- I am r38y on github.
- I am r38y (https://keybase.io/r38y) on keybase.
- I have a public key whose fingerprint is 9C92 BD4F 93E3 2505 CC1E AB3F 6CDC BC3B A534 087B
To claim this, I am signing this object:
#<ActionView::PathSet:0x007fc51b65c240 @paths=[#<ActionView::OptimizedFileSystemResolver:0x007fc513e22810 @pattern=":prefix/:action{.:locale,}{.:formats,}{.:handlers,}", @cache=#<ActionView::Resolver::Cache:0x007fc513e227e8 @data=#<ActionView::Resolver::Cache::SmallCache:0x007fc513e227c0 @backend={}, @default_proc=#<Proc:0x007fc51b545208@/Users/r38y/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.3/lib/action_view/template/resolver.rb:48 (lambda)>>>, @path="/Users/r38y/Sites/bntp.bauernet.me/app/views/site_overrides/j-14.com">, #<ActionView::OptimizedFileSystemResolver:0x007fc51b54d4f8 @pattern=":prefix/:action{.:locale,}{.:formats,}{.:handlers,}", @cache=#<ActionView::Resolver::Cache:0x007fc51b54d4d0 @data=#<ActionView::Resolver::Cache::SmallCache:0x007fc51b54d4a8 @backend={}, @default_proc=#<Proc:0x007fc51b545208@/Users/r38y/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/actionpack-4.0.3/lib/action_view/template/resolver.rb:48 (lambda)>>>, @path="/Users/r38y/Sites/bntp.bauernet.me/app/views">] |
# this is an initializer and used to set up various themes | |
# so we can use the same instances on each request | |
# I'm wondering if $path_set_registry should be a | |
# constant instead of a global variable | |
$path_set_registry = {} | |
Dir.entries('app/views/site_overrides').reject{|e| e.in?(['.', '..'])}.each do|domain| | |
paths = ["app/views/site_overrides/#{domain}"] | |
$path_set_registry[domain] = ActionView::PathSet.new(paths) | |
end |
I hereby claim:
To claim this, I am signing this object:
class NullPhoto | |
def file | |
@file = OpenStruct.new( | |
url: 'https://dossi-prod.s3.amazonaws.com/default-avatar.png' | |
) | |
end | |
# is this kosher? | |
def blank? | |
true |
require 'spec_helper' | |
describe 'creating a person' do | |
it 'works with valid attributes' do | |
user = create(:user) | |
post "/api/people.json", | |
{ person: { name: 'Bob Johnson' } }, | |
{ 'Authorization' => "Token token=#{user.authentication_token}" } |
CREATE DATABASE new_clone WITH TEMPLATE old_database; |
-- winning_count is a random number between 0 and 1 | |
-- times the sum of the weights | |
SELECT id | |
FROM ( | |
SELECT id, SUM(weight) OVER (ORDER BY id) S | |
FROM entries WHERE drawing_id = #{@drawing.id} | |
) Q | |
WHERE S >= winning_count | |
ORDER BY id | |
LIMIT 1; |
class ApplicationController < ActionController::Base | |
around_action :set_timezone | |
def set_timezone | |
old_time_zone = Time.zone | |
Time.zone = current_user.time_zone | |
yield | |
ensure | |
Time.zone = old_time_zone | |
end |
# HEROKU_POSTGRESQL_GREEN was the old master | |
# I promoted then got rid of the original master (because it was staging) | |
# noticed that the follower was still a follower | |
➜ twinit.bauernet.me git:(split-test) heroku pg:info -r staging | |
=== HEROKU_POSTGRESQL_MAROON_URL (DATABASE_URL) | |
Plan: Standard 2 | |
Status: Available | |
Data Size: 7.76 GB | |
Tables: 16 |
class Discussion < ActiveRecord::Base | |
include Tokenable | |
set_token_field_name :other_token_name | |
end |