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
//@server in express js file | |
var data = {}; | |
data.title = "My First APP"; | |
data.arr=[{x:1, y:1}, {x:2, y:2}, {x:3, y:4}]; | |
res.render('/ejsFile', data); |
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
angular.module('d3', []) | |
.factory('d3Service', ['$document', '$window', '$q', '$rootScope', | |
function($document, $window, $q, $rootScope) { | |
var d = $q.defer(), | |
d3service = { | |
d3: function() { return d.promise; } | |
}; | |
function onScriptLoad() { | |
// Load client in the browser | |
$rootScope.$apply(function() { d.resolve($window.d3); }); |
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
var express = require('express') | |
, routes = require('./modules/analytics/routes') | |
, http = require('http') | |
, path = require('path'); | |
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
#!/bin/bash | |
#Force file syncronization and lock writes | |
mongo admin --eval "printjson(db.fsyncLock())" | |
MONGODUMP_PATH="/usr/bin/mongodump" | |
MONGO_HOST="server_ip" #replace with your server ip | |
MONGO_PORT="27017" | |
USER_NAME="myDB" | |
PASSWORD="password" |
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
exports.AnalyticsDataBatchRequest = function(profileId, startDate, endDate, callback){ | |
var r1 = gapi.mainclient.analytics.data.ga.get({ | |
'ids': 'ga:' + profileId, | |
'start-date': startDate, | |
'end-date': endDate, | |
'metrics': 'ga:pageviews' | |
,'dimensions': 'ga:source, ga:keyword, ga:pagePath' | |
}); |
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
var aggregateData = function(wb, rb){ | |
for(var k in rb) { // | |
if(Object.prototype.toString.call(rb[k]) == '[object Object]'){ | |
if(wb.hasOwnProperty(k)){ | |
var ob1 = wb[k]; | |
var ob2 = rb[k]; |
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
var aws = require ('aws-lib'); | |
var options ={ | |
"path": "", // your queue path you can aws management console to find it | |
"version": "", // version-- its a date | |
}; | |
sqs = aws.createSQSClient(awsKey, awsPrivateKey, options); |
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
Directive Learnings: | |
*) Make the changes in the compile function, not link function if | |
You want to change the template. | |
*) If, however, you want to change the instances, make change in link function. | |
- Above 2 Mostly relevant for ng-repeat - | |
*) No scope available in compile function |
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
http://howtonode.org/ | |
http://highscalability.com/ | |
http://blog.mongodb.org/ | |
http://blog.libtorrent.org/ | |
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
Cloud: http://highscalability.com/blog/2014/6/5/cloud-architecture-revolution.html | |
AngularJS Directive: http://www.ng-newsletter.com/posts/directives.html | |
http://tutorials.jenkov.com/angularjs/custom-directives.html |
OlderNewer