Skip to content

Instantly share code, notes, and snippets.

View tychay's full-sized avatar

terry chay tychay

View GitHub Profile
@tychay
tychay / 0_reuse_code.js
Last active August 29, 2015 14:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tychay
tychay / config.js
Last active March 1, 2017 19:05 — forked from pywebdesign/config.js
Restangular adapter to expand compound documents from jsonapi.org
// This variation just injects the extracted data right into the relationships and also stores things in
// ._meta and ._included instead of just .included
// it (like restangular) requires either lodash or underscorejs
.config(function(RestangularProvider) {
// add a response interceptor
RestangularProvider.addResponseInterceptor(function(data, operation, what, url, response, deferred) {
var extractedData = data.data;