This file contains 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
app.directive("backToTop", ["$window", function ($window) { | |
return { | |
restrict: 'E', | |
transclude: true, | |
template: '<div class="back-to-top"><style>' + | |
'.back-to-top {' + | |
' position: fixed;' + | |
' opacity: 0;' + | |
'}' + | |
'.back-to-top.active {' + |
This file contains 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
setting a config var that contains JSON object: | |
heroku config:set CONNECTION_OPTIONS={\"userName\":\"...\",\"password\":\"...\",\"server\":\"...\",\"options\":{\"database\":\"...\"}} |
This file contains 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
define("directives/ngHold", ["app"], function (app) { | |
return app.directive('ngHold', [function () { | |
return { | |
restrict: "A", | |
link: function (scope, elm, attrs) { | |
}, | |
controller: ["$scope", "$element", "$attrs", "$transclude", "$timeout", function ($scope, $element, $attrs, $transclude, $timeout) { | |
var onHold = function () { | |
return $scope.$eval($attrs.ngHold); |
This file contains 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
npm config set msvs_version 2012 --global | |
This file contains 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
define("directives/captureClick", ["app"], function (app) { | |
return app.directive('captureClick', [function () { | |
return { | |
restrict: "A", | |
controller: ["$scope", "$element", "$attrs", "$transclude", function ($scope, $element, $attrs, $transclude) { | |
$element.click(function (e) { | |
e.stopPropagation(); | |
}); | |
}] | |
}; |
This file contains 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("requirejs").define("middleware/onlyCrawlers", ["url"], function (url) { | |
var crawlerUserAgents = [ | |
// 'googlebot', | |
// 'yahoo', | |
// 'bingbot', | |
'baiduspider', | |
'facebookexternalhit', | |
'twitterbot', | |
'rogerbot', | |
'linkedinbot', |
This file contains 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("requirejs").define("models/elasticsearchHelper", [], function () { | |
var Q = require("q"); | |
var ElasticSearchClient = require("elasticsearchclient"); | |
var serverOptions = JSON.parse(process.env.ES_SERVER_OPTIONS || "null") || { | |
host: "dwalin-us-east-1.searchly.com", | |
port: 443, | |
secure: true, | |
auth: { | |
username: "site", |
This file contains 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("requirejs").define("models/emailHelper", [], function () { | |
var Q = require("q"); | |
var emailjs = require("emailjs"); | |
var ejs = require('ejs'); | |
var fs = require('fs'); | |
var path = require('path'); | |
return { | |
send: function (templatePath,data,to,subject) { | |
var q= Q.defer(); |
This file contains 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("requirejs").define("models/redisHelper", [], function () { | |
var Q = require("q"); | |
var redis = require("redis"); | |
var connectionOptions = JSON.parse(process.env.REDIS_CONNECTION_OPTIONS); | |
var client = redis.createClient(connectionOptions.port, connectionOptions.host, {}); | |
client.auth(connectionOptions.password, function (err, reply) { | |
if(!!err) | |
{ | |
console.log(err); | |
} |
This file contains 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("requirejs").define("models/serverUtils", [], function () { | |
return { | |
getClientIp: function (req) { | |
// snippet taken from http://catapulty.tumblr.com/post/8303749793/heroku-and-node-js-how-to-get-the-client-ip-address | |
var ipAddress; | |
// The request may be forwarded from local web server. | |
var forwardedIpsStr = req.header('x-forwarded-for'); | |
if (forwardedIpsStr) { | |
// 'x-forwarded-for' header may return multiple IP addresses in | |
// the format: "client IP, proxy 1 IP, proxy 2 IP" so take the |
OlderNewer