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 lo-dash for averaging hover times and loops | |
//include benchmark.js for testing function runtimes | |
//make tags more versatile and use indexOf to see if the tag exists | |
console.time("executeTime"); | |
var StoreStats = (function($, window, document) { | |
"use strict"; | |
var scope = document.querySelectorAll(".storeStats"),$scope = $(scope), | |
socket = io.connect("http://ec2-54-184-116-0.us-west-2.compute.amazonaws.com:3000/"), |
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
String details = "7\""; | |
details = details.replace("\""," inch"); | |
System.out.println(details); // 7 inch |
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
/** | |
* Modified version of TJ's http support file from the Express repo: | |
* https://github.com/visionmedia/express/blob/master/test/support/http.js | |
* | |
* Module dependencies. | |
*/ | |
var EventEmitter = require('events').EventEmitter | |
, should = require('should') | |
, methods = ['get','post','put','delete','head'] |
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), | |
crypto = require('crypto'), | |
uuid = require('node-uuid'), | |
geoip = require('geoip-lite'), | |
storeStats = require('./storeStats.js'), | |
api = require('./api/api-endpoints'); |
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'), |
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
#!/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
#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
@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
fetchPromise: (endpoint, params = {})-> | |
deferred = $.Deferred (d)=> | |
@fetch endpoint, params, (res)-> | |
d.resolve res | |
, | |
(res) -> | |
d.reject res | |
deferred.promise() |
OlderNewer