Skip to content

Instantly share code, notes, and snippets.

View ahawkins's full-sized avatar
💭
🌈🏄🏼‍♂️🤙🏻

Adam Hawkins ahawkins

💭
🌈🏄🏼‍♂️🤙🏻
View GitHub Profile
class User
include Chassis::Persistance
include Serialization
include Chassis::HashInitializer
attr_accessor :name, :phone_number, :token, :device
def push?
!!device.push_token
end
class RedisMap
def initialize(redis)
@redis = redis
end
def clear
redis.del key
fail 'failed to delete' if redis.exists key
end
#!/usr/bin/env ruby
class PidFile
attr_reader :path
def initialize(path)
@path = path
end
def exists?
@ahawkins
ahawkins / paper.md
Last active December 27, 2015 02:08
Info about my upcoming paper on software architecture.

Abstract: This paper describes an application architecture that maximizes long term maintainability and feature deliverability for a certain class of applications. It covers effective use of boundaries, application roles, and application of design patterns to create an architecture that separates the core business logic from the delivery mechanisms. Problems with current approaches are covered. It finishes with a migration strategy for existing applications.

Title: Untitled for now, open to suggestions

Length: ~20,000 words, may become longer

Outline:

  • Introduction
  • System Design: Object roles, boundaries, protocols, patterns, and delivery mechanisms
ahawkins at ss in payment_service rake packer:build
packer validate /var/folders/w7/qv79fw593jb3nv67f3kksr000000gn/T/packer.json20130820-61971-tqxy1l
Template validated successfully.
git archive -o /tmp/archive.tar.gz HEAD
packer build /var/folders/w7/qv79fw593jb3nv67f3kksr000000gn/T/packer.json20130820-61971-1w2sh3b
amazon-ebs output will be in this color.
==> amazon-ebs: Creating temporary keypair for this instance...
==> amazon-ebs: Creating temporary security group for this instance...
==> amazon-ebs: Authorizing SSH access on the temporary security group...
class Logger
def log(msg)
EM.next_tick do
amqp_exchange.publish(msg)
end
end
end
join(:email_addresses, contact_id: :id).
where(account_id: query.account.id).
where(address: query.address).
limit(1).
first
@ahawkins
ahawkins / tests.rb
Last active December 18, 2015 17:19
# run with: ruby tests.rb
gem 'minitest'
require 'minitest/autorun'
require 'minitest/hell'
require 'net/http'
require 'uri'
class SitesTest < MiniTest::Test
App.DatePicker = Ember.TextField.extend
classNames: ['date-picker']
textToDateTransform: ((key, value) ->
if arguments.length == 2
if value && /\d{4}-\d{2}-\d{2}/.test(value)
parts = value.split '-'
date = new Date()
date.setYear parts[0]
date.setMonth parts[1] - 1