Skip to content

Instantly share code, notes, and snippets.

View andrewhao's full-sized avatar

Andrew Hao andrewhao

View GitHub Profile
@andrewhao
andrewhao / pass_1.rb
Last active October 18, 2016 16:16
The Joy of Naming - Domain Driven Design
class Checkout
  def initialize(booking_amount, discount)
    @booking_amount = booking_amount
    @discount = discount
  end
 
  def total
    @booking_amount.total - @discount.calculate_amount_for(booking_amount: booking_amount)
  end
end
@andrewhao
andrewhao / elixir_buildpack.config
Last active June 29, 2016 22:47
Rails and Phoenix Session Sharing
# elixir_buildpack.config
config_vars_to_export=(SECRET_KEY_BASE SESSION_ENCRYPTED_COOKIE_SALT SESSION_ENCRYPTED_SIGNED_COOKIE_SALT DOMAIN)

Keybase proof

I hereby claim:

  • I am andrewhao on github.
  • I am andrewhao (https://keybase.io/andrewhao) on keybase.
  • I have a public key whose fingerprint is ABAD 072E 4722 22E2 9E81 F71C 9865 AEB1 52A6 945A

To claim this, I am signing this object: