Skip to content

Instantly share code, notes, and snippets.

@drhenner
drhenner / gist:2655665
Created May 10, 2012 20:25
Ruby Job Description
class Geek < Person
include StarWarsFan
end
class SeniorSoftwareDeveloper < Geek
def initialize(information, ruby_projects = [])
@likes = ["Ruby", "JavaScript", "Software Meetups", "Startups", "Code Reviews"]
@minimum_qualifications = [ "2 years of ruby, 1 year if you kicked butt",
"Writes tests for code.",
@drhenner
drhenner / gist:8462170
Created January 16, 2014 19:53
Form Objects vs. Inheritance
# The purpose of this gist is to propose use of inheritance when upgrading objects to have "more functionality".
# For example:
# Lets say you have a `company` model and your project manager purposes a huge pivot to your existing application.
# Now new fields are "required" for the new companies you create. Unfortunately adding validators to the existing
# `company` model will cause things to blow up. You could create a form object for the new forms with form specific
# validators. Several issues are now introduced:
# 1) There can be several form objects for the company. Each with a slight difference in logic.
@drhenner
drhenner / gist:1e8099e2db45a3d0e251
Created January 20, 2016 16:22
My bash_profile
alias backop='cd /User/davidhenner/projects/backops'
alias start_mongo='mongod'
alias start_redis='redis-server'
alias start_memcached='memcached -v'
alias git_sort="git for-each-ref --sort=-committerdate refs/heads/ --format='%(color:magenta)%(committerdate:short)|%(color:green)%(refname:short)|%(color:blue)%(subject)%(color:reset)' | column -ts'|'"
alias git_sort10="git_sort | head -10"
alias git10="git_sort | head -10"
alias git20="git_sort | head -20"
alias gitpush="git push"
alias backop='cd /User/davidhenner/projects/backops'
alias start_mongo='mongod'
alias start_redis='redis-server'
alias start_memcached='memcached -v'
alias git_sort="git for-each-ref --sort=-committerdate refs/heads/ --format='%(color:magenta)%(committerdate:short)|%(color:green)%(refname:short)|%(color:blue)%(subject)%(color:reset)' | column -ts'|'"
alias git_sort10="git_sort | head -10"
alias git10="git_sort | head -10"
alias git20="git_sort | head -20"
alias git30="git_sort | head -30"
@drhenner
drhenner / ackrc
Created April 15, 2016 18:54
SAMPLE .ackrc
--ignore-dir=tmp
--ignore-dir=dist
--ignore-dir=log
--ignore-dir=coverage
--ignore-file=ext:map
@drhenner
drhenner / MessageBus
Created August 4, 2017 06:14
Message Bus
###################################################################
# A Topic is a superclass that all Communications inherit from
#
# A Communication Channel will accept a number of firms_topics it wants communications for.
# eg. A mobile Device will by default want to hear all communications.
# If the device adds a filter they will not accept communications for
# That type of message.
#
# If it accepts a given firms_topic and there is a message to send. The firms_topic
# has one topic "belongs_to :topic" that performs the method `Process`.

Keybase proof

I hereby claim:

  • I am drhenner on github.
  • I am drhenner (https://keybase.io/drhenner) on keybase.
  • I have a public key ASCEi8vLaDPiQZmtlBjcMzAkdzpd3CaS5t1rb0id3Rr40Ao

To claim this, I am signing this object:

@drhenner
drhenner / credit_card_validator.js
Created October 19, 2011 18:00
Credit card validator (jQuery)
var Hadean = window.Hadean || { };
Hadean.Validators = {
CreditCards : {
currentCardType : null,
creditCardInput : null,
cardRegexps : [
[ 'Visa Electron' , /^(417500|(4917|4913|4508|4844)\d{2})\d{10}$/ ]
, [ 'Visa' , /^4\d{12}(\d{3})?$/ ]
, [ 'MasterCard' , /^(5[1-5]\d{4}|677189)\d{10}$/ ]
David Henner, The Mighty, First of His Name, from Town of Sterling, the Village of Fair Haven, the School of Red Creek, Grandson of a Roadkill Cook, Son of a Worm Farmer, Brother of a Twin Sister, High Purveyor of Ye Olde Avian Leg, Scrubber of PII, Enforcer of Foreign Laws, Eraser of Erroneous Curly Braces, Champion of Mondays, Breaker of Free-Radicals, Giver of Hennerfirmations, Lemon Monger, Hunched Claw Coder, Object Heaver, Known to Siri as "a IHOP in Ashland," Stand-up Athlete, 1/2 Pint Guac Believer, Soap Nuts Cleanser, SMS 2FA intercepted, Accumulator of 100,801 Unread Emails, 'Beaver Butt Juice' PSAer, Deploy Train Conductor, AaSS, Forida Man prospect, YouTube Worm Influencer