- Twitter: @adman65
- Website or Blog: http://hawkins.io
- Company: Saltside Technologies http://saltside.se
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class User | |
| include Chassis::Persistance | |
| include Serialization | |
| include Chassis::HashInitializer | |
| attr_accessor :name, :phone_number, :token, :device | |
| def push? | |
| !!device.push_token | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class RedisMap | |
| def initialize(redis) | |
| @redis = redis | |
| end | |
| def clear | |
| redis.del key | |
| fail 'failed to delete' if redis.exists key | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| class PidFile | |
| attr_reader :path | |
| def initialize(path) | |
| @path = path | |
| end | |
| def exists? |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Logger | |
| def log(msg) | |
| EM.next_tick do | |
| amqp_exchange.publish(msg) | |
| end | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| join(:email_addresses, contact_id: :id). | |
| where(account_id: query.account.id). | |
| where(address: query.address). | |
| limit(1). | |
| first |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # run with: ruby tests.rb | |
| gem 'minitest' | |
| require 'minitest/autorun' | |
| require 'minitest/hell' | |
| require 'net/http' | |
| require 'uri' | |
| class SitesTest < MiniTest::Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |