Skip to content

Instantly share code, notes, and snippets.

View timshadel's full-sized avatar

Tim Shadel timshadel

View GitHub Profile

XML and JSON already have generic mechanisms to "signal how to interpret the target resource", we don't need to add any more.

represented state may not be exhaustive lists elements may not be the exhaustive set

any object or list which can be retrieved individually may be referenced locally within the hypermedia representation

the natural representation of properties signals the interpretation the natural representation of lists is insufficient to signify

  • it's href

XML and JSON already have generic mechanisms to "signal how to interpret the target resource", we don't need to add any more.

represented state may not be exhaustive lists elements may not be the exhaustive set

any object or list which can be retrieved individually may be referenced locally within the hypermedia representation

the natural representation of properties signals the interpretation the natural representation of lists is insufficient to signify

  • it's href
var hasOwn = Object.prototype.hasOwnProperty;
function mirrorProperties(target, source) {
for (var prop in source) {
if (!hasOwn.call(target, prop)) {
target[prop] = source[prop];
}
}
}
/**
* Original function
*/
function original(a, b) {
console.log('I am original. I return a + b.');
return a + b;
}
//==============

Made Media

Made can be used to represent objects. It has links, Web Linking (RFC 5988) rels, and more.

Basics

At its simplest, it holds data exactly like JSON.

Managing Multiple Environments on Heroku

Using Heroku to work with multiple environments can be pretty easy. The heroku tool can look at your git remotes to decide which app should receive the API commands.

Default Setup

The origin remote

@timshadel
timshadel / test.md
Last active December 14, 2015 20:48

Straight

Add a staging deployment
$ heroku create myapp-stage -r stage
Creating myapp-stage... done, stack is cedar
http://myapp-stage.herokuapp.com/ | [email protected]:myapp-stage.git
Git remote stage added

Check that the git remote was named properly
/**
* Module dependencies
*/
var knox = require('knox')
, async = require('async')
, url = require('url');
/**
* node fixheaders.js s3://bucket/prefix
*/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.