- http://en.wikipedia.org/wiki/HATEOAS
- http://www.infoq.com/author/Mike-Amundsen
- http://www.zapthink.com/2012/01/10/the-api-is-dead-long-live-the-api/
- http://www.zapthink.com/2011/11/22/the-secret-to-a-restful-cloud/
- http://deltacloud.apache.org/
- http://fedoraproject.org/wiki/Cloud_APIs_REST_Style_Guide
- https://blogs.oracle.com/craigmcc/entry/why_hateoas
This file contains 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
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit |
This file contains 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
# No arguments: `git status` | |
# With arguments: acts like `git` | |
g() { | |
if [[ $# > 0 ]]; then | |
git $@ | |
else | |
git status | |
fi | |
} |
So for the active record-y interface, we're going to see naive method chains like this:
# transitions invocations
home.client_divisions.client_division(uuid).studies.create(params)
# Or trying to access an attribute
home.client_divisions.client_division(uuid).studies.study(uuid).name
Attributes should be terminal calls, and probably shouldn't exist outside of an if else or case statement, but if we have method missing return the representor self if it doesn't match a method, these chains will basically progress as far as they know how to. So if studies gets cool and is renamed studiez, the result of the above call would be the client division representor. Then we could write a meaningfull ===
for case statements, which would let code for dealing with this look like this:
This file contains 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
# Provide the PID of a running rails process, and dump the heap to heap.json | |
# WARNING these can get pretty huge (~100MB) | |
# requries ruby 2.1 for shiny new ObjectSpace features | |
rbtrace -p <PID> -e 'Thread.new{require "objspace"; ObjectSpace.trace_object_allocations_start; GC.start(); ObjectSpace.dump_all(output: File.open("heap.json", "w"))}.join' |