Skip to content

Instantly share code, notes, and snippets.

View pc-rgundlapalli's full-sized avatar

Ravi Gundlapalli pc-rgundlapalli

  • Personal Capital
View GitHub Profile
@pc-rgundlapalli
pc-rgundlapalli / gist:b7efb44cfabde8cbd9f3
Created October 3, 2014 19:25
string invocation of chart
phantomjs chart.js -input "{\"previousMonth\": { \"label\": \"Aug\", \"series\": [ { \"day\": \"01\", \"value\": \"472091.61\" }, { \"day\": \"02\", \"value\": \"472087.36\" }, { \"day\": \"03\", \"value\": \"472087.36\" }, { \"day\": \"04\", \"value\": \"472497.21\" }, { \"day\": \"05\", \"value\": \"470729.95\" }, { \"day\": \"06\", \"value\": \"470572.58\" }, { \"day\": \"07\", \"value\": \"470751.85\" }, { \"day\": \"08\", \"value\": \"470756.51\" }, { \"day\": \"09\", \"value\": \"470687.7\" }, { \"day\": \"10\", \"value\": \"470425.95\" }, { \"day\": \"11\", \"value\": \"470178\" }, { \"day\
(function () {
var mapCLArguments,
render,
args = {},
env = {
'D' : 'https://devtrunk.awspcap.com',
'Q' : 'https://qatrunk.awspcap.com',
'S' : 'https://staging.personalcapital.com',
'P' : 'https://home.personalcapital.com'
/* E*Trade Scrape
run on command line: casperjs etrade_scrape.js [USERNAME] [PASSWORD] [ACCT_LAST_4_DIGITS]
*/
var casper = require('casper').create();
var account_last_4 = casper.cli.raw.args[2];
casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4');
casper.start('https://us.etrade.com/home', function() {
// ERROR CHECK:
// User must enter USERNAME, PASSWORD, and ACCT_LAST_4_DIGITS parameters:
@pc-rgundlapalli
pc-rgundlapalli / cpages.js
Created June 2, 2014 18:00
node version of cpages.php
var captoraUtils = {};
captoraUtils.getLandingPage = function(req, res, next){
logger.debug('getLandingPage', landingPage)
var CAPTORA_PAGES_PREFIX = 'http://cdn.captora.com/pages/personalcapital.com/v1/html/',
CAPTORA_PAGES_DEFAULT = 'https://www.personalcapital.com',
CAPTORA_PAGES_TIMEOUT = 10,
landingPage = req.params.pageName,
responseStream = '';
@pc-rgundlapalli
pc-rgundlapalli / chart.js
Last active August 29, 2015 14:01
phantom tests
(function () {
var config = {
/* define locations of mandatory javascript files */
files: {
JQUERY: 'jquery.min.js',
UNDERSCORE: 'underscore.js',
RAPHAEL: 'raphael.min.js',
PERSPECTIVE: 'perspective.js'
}
@pc-rgundlapalli
pc-rgundlapalli / karma.conf
Created February 11, 2014 14:23
Karma configuration to automate javascript unit tests
// Karma configuration
// Generated on Sun Sep 08 2013 07:19:12 GMT-0700 (PDT)
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '../',
@pc-rgundlapalli
pc-rgundlapalli / gist:4179650
Created December 1, 2012 00:03
updated settings.xml
<server>
<id>pcap-static</id>
<username>rgundlapalli</username>
<password>password</password>
</server>
....
...
...
<repository>
@pc-rgundlapalli
pc-rgundlapalli / gist:4163461
Created November 28, 2012 19:25
Handling backbone views
// adding close method to all backbone views
Backbone.View.prototype.close = function(){
this.remove();
this.unbind();
if (this.onClose){
this.onClose();
}
}
myView.js