Skip to content

Instantly share code, notes, and snippets.

View hale's full-sized avatar

Philip Hale hale

View GitHub Profile

Keybase proof

I hereby claim:

  • I am hale on github.
  • I am pghale (https://keybase.io/pghale) on keybase.
  • I have a public key ASAZcHyS_piB4LcxmdM1WUgBGXOwPs7SHybbRbIRrVgGeAo

To claim this, I am signing this object:

NOTE: Payment of a business registry fee and issuance of a business registry certificate do not necessarily entitle you to conduct business in the City of Palo Alto. As the owner or operator of a business, you must comply with all applicable zoning and public safety regulations and obtain all required permits.

THIS INFORMATION IS NOT A COMPLETE LISTING OF CLEARANCES THAT MIGHT BE REQUIRED

  1. If you intend to alter, remodel, relocate, or install any structural, electrical, plumbing, or mechanical portions of the building, you will need to obtain building permits from the Development Services Department at (650) 329-2496
  2. Businesses involving any use changes, exterior building changes, or sign changes are advised to secure Department of Planning and Community Environment approval prior to lease execution or purchase. Contact the Planning and Community Environment Department at (650) 329-2442
  3. Businesses operated out of the home must comply with Home Occupation Regulations (Section 18.42.060 of the Munici
@hale
hale / test.rb
Created September 23, 2014 18:05
class NotOnTheListError < StandardError; end
module Security
module Bouncer
THE_LIST = %w(john disco_stu)
def enter(name)
unless THE_LIST.include?(name)
raise NotOnTheListError.new("Sorry #{name}, you're not on the list")
end
@hale
hale / test.rb
Created September 23, 2014 17:58
module Security
module Bouncer
THE_LIST = %w(john)
def enter(name)
raise "Sorry #{name}, you're not on the list" unless THE_LIST.include?(name)
puts "Hey #{name}, come on through."
super(name)
end
end
@hale
hale / notes.md
Last active August 29, 2015 14:01

Contact Manager: Notes

Rails 4.0.4

  • There's some compatibility issues between Rails 4.1 and PgSearch which I might use for steps 2-3, so sticking with 4.0.4.

Validations

  • Does not validate against whitespace-only fields or fields beginning with whitespace.
@hale
hale / -
Created October 10, 2013 16:04
BSS
can permutate A into B given a list of swaps (FAILED - 1)
all together now (FAILED - 2)
#apply_swap!
works for 2 elements
works for 4 elements
#swaps
works for 2 elements
works for 3 elements
@hale
hale / -
Created October 4, 2013 17:50
#<NoMethodError: undefined method `+' for nil:NilClass>
[Worker(host:5dd14c30-3419-457a-9329-7eab37d07e39 pid:2)] RailsNlp::TextAnalyser#update_analysis completed after 0.5470
[Worker(host:5dd14c30-3419-457a-9329-7eab37d07e39 pid:2)] 1 jobs processed at 1.7184 j/s, 0 failed ...
[Worker(host:5dd14c30-3419-457a-9329-7eab37d07e39 pid:2)] WebService#update_tank_indexes_without_delay completed after 0.0971
[Worker(host:5dd14c30-3419-457a-9329-7eab37d07e39 pid:2)] 1 jobs processed at 9.2152 j/s, 0 failed ...
@hale
hale / gist:6415083
Last active December 22, 2015 04:09
Hacky fix for failing search reindex in Honolulu Answers; analysemodels rake task starts from scratch, drops the tables.
diff --git a/app/models/guide_step.rb b/app/models/guide_step.rb
index da18e96..f36f8fb 100644
--- a/app/models/guide_step.rb
+++ b/app/models/guide_step.rb
@@ -2,4 +2,10 @@ class GuideStep < ActiveRecord::Base
include TankerArticleDefaults
belongs_to :guide, :class_name => 'Guide', :foreign_key => 'article_id'
attr_accessible :article_id, :title, :content, :preview, :step
+
+ delegate :category, :tags, :keywords, :to => :guide
@hale
hale / -
Created August 22, 2013 11:46
" My Bundles
Bundle 'gmarik/vundle'
Bundle 'MarcWeber/vim-addon-mw-utils'
Bundle 'tomtom/tlib_vim'
Bundle 'mileszs/ack.vim'
Bundle 'airblade/vim-rooter'
Bundle 'rizzatti/funcoo.vim'
Bundle 'rizzatti/dash.vim'
Bundle 'chriskempson/base16-vim'
Bundle 'tpope/vim-rails'
(function() {
var Stripe, exports, key, _i, _len,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
_this = this;
this.Stripe = (function() {
function Stripe() {}