This file contains hidden or 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
var http = require('http'); | |
var router = require('routes')(); | |
var Busboy = require('busboy'); | |
var AWS = require('aws-sdk'); | |
var inspect = require('util').inspect; | |
var port = 5000; | |
// Define s3-upload-stream with S3 credentials. | |
var s3Stream = require('s3-upload-stream')(new AWS.S3({ | |
accessKeyId: '', |
This file contains hidden or 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
PRO: | |
- Self documenting. Exploring data becomes trivial. | |
- Mobile devs can request everything once | |
- Mobile devs only get the data they need | |
- You don’t have to know your active record relations. | |
CON: | |
- You have to manually write all end points | |
- Attributes can become bloated. Suppose we make a breaking update to an attribute. The solution is to create a new attribute. |
This file contains hidden or 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
//var today = moment(); | |
//1.42 2.53 | |
//build month grouping hash | |
//for (var i=0; i < items.length ; i++) { | |
// var due_date = items[i].due_date; | |
// var grp = (moment(due_date) < today) ? today.format('MMM YYYY') : moment(due_date).format('MMM YYYY'); | |
// if (groupings[grp] == null) { | |
// groupings[grp] = [items[i]]; | |
// }else{ |
This file contains hidden or 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
//copy and paste me into cjs | |
window.WWMobileNg.GoogleTagManager.createEventData = function (gtmTagName, event, wwEventAction, wwEventCategory, wwEventLabel) { | |
var event_data; | |
event_data = { | |
'GTM Tag Name': gtmTagName, | |
'wwEvent': event, | |
'wwEventAction': wwEventAction, | |
'wwEventCategory': wwEventCategory, | |
'wwEventLabel': wwEventLabel | |
}; |
This file contains hidden or 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
require 'fog' | |
require 'json' | |
require 'pp' | |
require 'chef' | |
connection = Fog::Compute.new( | |
:aws_access_key_id => #insert id here, | |
:aws_secret_access_key => #insert secret here, | |
:provider => 'AWS' | |
) |
This file contains hidden or 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
include_recipe "ohai" | |
bin_path = ::File.join(node['rbenv']['root_path'], "bin", "rbenv") | |
template "#{node[:ohai][:plugin_path]}/rbenv.rb" do | |
source 'plugins/rbenv.rb.erb' | |
owner 'root' | |
group 'root' | |
mode 0755 |