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 URL = function(url){ | |
| this.url = url; | |
| this.parsed = false; | |
| return this; | |
| }; | |
| URL.prototype.queryStrings = function(queryString){ | |
| var qs = queryString.replace('?', '').split('&'), result = {}; | |
| for(var i=0; i<qs.length; i++) { | |
| var item = qs[i].split("="); |
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 config = require("../config.js"); | |
| var gm = require("gm"), imageMagick = gm.subClass({ imageMagick: true }); | |
| var httpg = require("http-get"); | |
| var imgSize = require("image-size"); | |
| var Q = require('Q'); | |
| var s3 = require('knox'); | |
| var _ = require("underscore"); | |
| var image = 'tmp/test.jpeg'; | |
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 config = require('./config'); | |
| var express = require('express'); | |
| var request = require('request'); | |
| var fs = require('fs'); | |
| var port = process.env.WEB_PORT || 8082; | |
| var app = express(); | |
| function https(req, res, next) { | |
| var proto = req.header('X-Forwarded-Proto'); |
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
| /* | |
| Given two arrays, return an array of items that intersect | |
| without using indexOf(). | |
| */ | |
| function compare(a,b){ | |
| } | |
| compare([1,3,4,5,8], [2,4,5,7]); |
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 queue = function(){ | |
| var self = this; | |
| self.free = true; | |
| self.chain = []; | |
| self.next = function(){ | |
| if(self.chain.length > 0){ | |
| self.free = true; | |
| self.chain[0].call(); |
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 Branch = function Branch(app_id, debug) { | |
| 'use strict'; | |
| this.api = {}; | |
| this.utils = {}; | |
| // Begin Utilities | |
| this.utils.console = function(stdout) { | |
| if (debug) console.error(stdout); | |
| return false; | |
| }; | |
| this.utils.readSession = function() { |
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 ACL = function(){ | |
| // Determine the average customer lifespan. To do this, we have to | |
| // determine what constitutes churn and then apply those rules to output | |
| // a snapshot of users vs. churn for each cycle. | |
| // 1. After what period of inactivity (no purchases) is a user likely to never | |
| // make another purchase (estimated churn). | |
| // 2. Removal of the app can be considered clear churn. | |
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 awssdk = require('aws-sdk'); | |
| awssdk.config = new awssdk.Config(); | |
| awssdk.config.accessKeyId = self.config.aws.id; | |
| awssdk.config.secretAccessKey = self.config.aws.secret; | |
| awssdk.config.region = self.config.aws.region; | |
| // token and secret variables obtained from Twitter | |
| // oAuth flow; same tokens work to query Twitter REST API. | |