Skip to content

Instantly share code, notes, and snippets.

View krainboltgreene's full-sized avatar
🏠
Working from home

Kurtis Rainbolt-Greene krainboltgreene

🏠
Working from home
View GitHub Profile
AUTHOR "Kurtis Rainbolt-Greene <me@kurtisrainboltgreene.name>"
ISO boot2docker
MACHINE diffeng
CONTAINER web
FROM ubuntu:latest
APPLY ruby:latest
APPLY nodejs:latest
# Brainstorming A Ruby-based API to API mapper
There are three defined layers:
- Deserializer (Format -> Native)
- Normalizer (accounts.name -> accounts.FullName)
- Serializer (Native -> Format)
JSONDesieralizer

Keybase proof

I hereby claim:

  • I am krainboltgreene on github.
  • I am krainboltgreene (https://keybase.io/krainboltgreene) on keybase.
  • I have a public key whose fingerprint is 4AF7 04F0 A6FC D13A 396B 9EBD AFC4 C83D C34B D7ED

To claim this, I am signing this object:

@krainboltgreene
krainboltgreene / gist:a6119c640e72c8df46c7
Created May 18, 2014 07:12
A better file manipulation command for unix systems
$ file list [FLAGS] [PATH | .]
$ file create [FLAGS] PATH
$ file open [FLAGS] [PATH | .]
$ file enter PATH
$ file delete PATH
$ file info [PATH | .]
@krainboltgreene
krainboltgreene / postgresql.dov
Last active August 29, 2015 14:02
A dragon pg gem
needs("postgresql")
needs("orm")
client: PostgreSQL Client clone(url: ENV POSTGRESQL_URL)
table: PostgreSQL Table clone(client: client, name: "accounts")
query: PostgreSQL Query Select clone(fields: ["id", "name"], table: table, where: { name: "?" }, parameters: ["%urtis%"])
query to_s() # => SELECT id, name FROM accounts WHERE name = "%urtis%";
Index: Controller clone() ->
setup: method(name, email, password) ->
Account Model transaction ->
@account: Account Model create(name: name, password: password, name: name)
@notifications: Account Notifier clone(model: @account)
if(condition: account save()) ->
@notifications trigger(events: ["send_email", "update_metrics"])
Account Notifier: Notifier clone() ->
setup: method(model) ->
@krainboltgreene
krainboltgreene / hacksim.md
Created August 3, 2014 18:53
hacklife stuff

hacktycoon

Hacktycoon is an open source game that simulates the career and life of software developers. In a few cases I've given up on realism for the sake of gameplay, but I understand if you're critical of those choices.

The game has three win conditions:

  • Noble victory, which is a win where the world good you do has reached a certain amount
  • Capitalist victory, which is a win where the money you make yearly has reached a certain amount
require "webstack"
require "webstack-throttle"
require "webstack-protection"
require "webstack-tempfile_manager"
require "webstack-deserializer"
require "webstack-dispatcher"
require "webstack-content_length_setter"
require "webstack-content_type_setter"
require "webstack-accept_setter"
require "webstack-serializer"
@krainboltgreene
krainboltgreene / gist:1d00227eb6319b1d83c0
Last active August 29, 2015 14:07
An example of dragon method calls
Person: Thing clone
setup: method
prefix: "The Infamous"
moniker: method
"{{prefix}} {{name}}, age {{age}}"
actor: Person create
name: "Kurtis Rainbolt-Greene"
Deserializer: "I turn raw formats into native data."
Router: "I correctly dispatch requests."
Control: "I coordinate and return a status, headers, and body."
Normalizer: "I sanitize the payload."
Validator: "I make sure there is nothing wrong with the data."
Abstract: "I store or lookup data."
Presenter: "I act as a wrapper around the abstract."
Denormalizer: "I sanitize the outgoing data."
Serializer: "I turn native data into raw formats."