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
post: (endpoint, params = {})-> | |
defer = $.Deferred() | |
$.when( | |
@requestChallenge() | |
).then( | |
(res) => | |
@authChallenge(res) | |
, | |
(res) => |
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
export PATH=/usr/local/bin:$PATH | |
export JAVA_6_HOME=$(/usr/libexec/java_home -v 1.6) | |
export JAVA_8_HOME=$(/usr/libexec/java_home -v 1.8) | |
export MYSQL_PORT=3306 | |
export SMTP_SERVER=smtp.gmail.com | |
export SMTP_PORT=587 | |
export SMTP_DOMAIN=gmail.com | |
export [email protected] | |
export SMTP_PASSWORD=password | |
export SMTP_ENABLE_STARTTLS_AUTO=true |
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
while true; do sleep 1; curl http://www.google.com; echo -e '\n\n\n\n'$(date);done |
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
test = { | |
urlRoot: "http://google.com", | |
url: function(options) { | |
var path; | |
if(options && options.param && options.query) { | |
path = "?" + options.param + "=" + options.query; | |
} | |
return (path) ? this.urlRoot + path : this.urlRoot; | |
} |
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
fetchPromise: (endpoint, params = {})-> | |
deferred = $.Deferred (d)=> | |
@fetch endpoint, params, (res)-> | |
d.resolve res | |
, | |
(res) -> | |
d.reject res | |
deferred.promise() |
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
@PM.module 'Layouts', (Layouts, App, Backbone, Marionette) -> | |
class Layouts.FeedbackLayout extends Layouts.CompositeList | |
className: 'row feedback composite-list-wrapper max-container' | |
template: 'feedback/feedback' | |
historyIndex: 1 | |
initialize: -> | |
@addRegions({ | |
productHistory: '.product-history-container' | |
}) |
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
#storing collections like surveys, past products and other things | |
#when possible to reduce network requests and make things more snappy | |
#overriding sync to use local storage when possible | |
class Backbone.localStorageSync extends Backbone.Model | |
@sync = (method, model, options) -> | |
_.defaults(options || (options = {}), { | |
add: true | |
}) |
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
#!/bin/bash | |
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
############################################### | |
# To use: | |
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh | |
# chmod 777 install-redis.sh | |
# ./install-redis.sh | |
############################################### | |
echo "*****************************************" |
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
this.loginUser = function(user, callback) { | |
//plans for changing this to promises once i do error reporting | |
// var q = Q.defer(); | |
// if() { | |
// q.resolve(num+1); | |
// } else { | |
// q.reject("error message"); | |
// } | |
// return q.promise; |
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 express = require('express'), | |
app = express(), | |
server = require('http').createServer(app); | |
io = require('socket.io').listen(server), | |
jwt = require("jwt-simple"), | |
secret = "dgv33rggr3ewsfsf23gf2grwrf", | |
crypto = require('crypto'), | |
uuid = require('node-uuid'), | |
geoip = require('geoip-lite'), | |
storeStats = require('./storeStats.js'), |