Skip to content

Instantly share code, notes, and snippets.

Philip Hale hale

Block or report user

Report or block hale

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pa_tandc.markdown

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.


  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
View test.rb
class NotOnTheListError < StandardError; end
module Security
module Bouncer
THE_LIST = %w(john disco_stu)
def enter(name)
unless THE_LIST.include?(name)
raise"Sorry #{name}, you're not on the list")
View test.rb
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."

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.


  • Does not validate against whitespace-only fields or fields beginning with whitespace.
View -
can permutate A into B given a list of swaps (FAILED - 1)
all together now (FAILED - 2)
works for 2 elements
works for 4 elements
works for 2 elements
works for 3 elements
View -
#<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 / gist:6415083
Last active Dec 22, 2015
Hacky fix for failing search reindex in Honolulu Answers; analysemodels rake task starts from scratch, drops the tables.
View gist:6415083
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
View -
" 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'
View stripe.js
(function() {
var Stripe, exports, key, _i, _len,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (, 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() {}
View CS3517 (Languages) notes - Week

CS3518 Formal Languages and Computability: Week One Summary

Formal Languages


  • Symbol: basic unit
  • Alphabet: finite set of symbols
  • String over alphabet T: finite sequence of symbols from T
  • Empty string: string with no symbols, lambda, λ.
You can’t perform that action at this time.