Skip to content

Instantly share code, notes, and snippets.

View smarigowda's full-sized avatar
🎯
Focusing

Santosh Marigowda smarigowda

🎯
Focusing
  • UK
View GitHub Profile
@smarigowda
smarigowda / audit_log_parser.js
Last active August 29, 2015 14:16
Audit Log Parser
console.log('node 01 and node 02');
console.log('latency summary of each transaction type including message direction IN/ OUT');
var file = 'file_path';
function qtile (leaves, ptile) {
return d3.quantile(leaves.map(function(d) { return +d.latency }).sort(), ptile);
}
function report(file) {
@smarigowda
smarigowda / gitCommands
Created January 21, 2015 16:42
git commands
-- setup a new repository
echo "# mygo" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/smarigowda/mygo.git
git push -u origin master
@smarigowda
smarigowda / JavaScript.js
Last active August 29, 2015 14:10
JavaScript
//nice way to populate object with route and hanldler
route = {
routes: {},
for: function(path, handler) {
this.routes[path] = handler;
}
}
@smarigowda
smarigowda / nodejs
Created November 3, 2014 13:45
Node.js
-- Generic uncaught exception handler
process.on('uncaughtException', function(err) {
console.error(err.stack);
});
@smarigowda
smarigowda / myvicommands
Last active August 29, 2015 14:08
My Commands
ctrl + u -- clear command line
ctrl + y -- recall cleared line
ctrl + w -- clear the previous word
curl -k https://localhost:443/.... -- turn off ssl certification
curl -v -k https://... -- response headers
curl -v -k -X POST http://localhost:3000
curl -v -k -X DELETE -b skySSO=00-058bd7d38838... -- sending cookie
-- using xargs
@smarigowda
smarigowda / SOASTAJavaScript.js
Last active January 23, 2017 15:01
SOASTA JavaScript Snippets
// ------------------------------------------------------------------------------------------------------
// find previous message
// ------------------------------------------------------------------------------------------------------
function findPriorMessage() {
var priorMessage = $context.currentItem.previousItem;
for (;;) {
<div ng-app="wizardApp">
<div ng-controller="WizardSignupController">
<h2>Signup wizard</h2>
<div ui-view></div>
</div>
</div>
<script type="text/javascript" src="/js/vendor/angular-ui-router/release/angular-ui-router.min.js"></script>
<script type="text/javascript">
angular.module('wizardApp', [
'ui.router',
@smarigowda
smarigowda / d3.js
Created December 11, 2013 20:15 — forked from auser/d3.js
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); });