Skip to content

Instantly share code, notes, and snippets.

View timshadel's full-sized avatar

Tim Shadel timshadel

View GitHub Profile
@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/ | git@heroku.com:myapp-stage.git
Git remote stage added

Check that the git remote was named properly

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

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.

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

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
@timshadel
timshadel / app-password.js
Last active December 12, 2015 01:08 — forked from camshaft/app.js
/**
* Module dependencies
*/
var request = require("superagent"),
password = require("password"),
password.initialize(require("password-bearer"));
/**
* Make the request
*/
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
+ (NSString *)platform;
//
// UIImage+H568.h
//
// Created by Angel Garcia on 9/28/12.
// Copyright (c) 2012 angelolloqui.com. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImage (H568)