Skip to content

Instantly share code, notes, and snippets.

View ashanbh's full-sized avatar

amit shanbhag ashanbh

View GitHub Profile
@ashanbh
ashanbh / install_elk.sh
Last active March 28, 2017 18:08
install elasticsearch, logstash, kibana on one ubuntu instance. This fixes issues with startup script that prevent your services from starting. (courtesy amit, https://rocketreach.co )
#!/bin/bash
echo --- Update packages ---
sudo apt -y update
sudo apt -y upgrade
sudo apt-get update
sudo apt-get upgrade
echo --- Install packages ---
#java
/*************
* ambush.js *
*************
*
* Oh. Oh, I see. This wasn't quite part of the plan.
*
* Looks like they won't let you take the Algorithm
* without a fight. You'll need to carefully weave your
* way through the guard drones.
*
/**********************
* fordingTheRiver.js *
**********************
*
* And there's the river. Fortunately, I was prepared for this.
* See the raft on the other side?
*
* Everything is going according to plan.
*/
/*******************
* intoTheWoods.js *
*******************
*
* Ah, you're out of the woods now. Or into the woods, as the
* case may be.
*
* So take a deep breath, relax, and remember what you're here
* for in the first place.
*
@ashanbh
ashanbh / angTest.html
Created February 10, 2015 03:11
Angular binding performance test
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - example-ngControllerAs-production</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.0-beta.1/angular.min.js"></script>
<script >
(function(angular) {
'use strict';
angular.module('controllerAsExample', [])
var globalObject =0;
function incInf1500(time){
return function(){
var local = globalObject;
console.log("Start "+time+ " : "+local);
setTimeout(function(){
globalObject=local+1;
console.log("End "+time+ " : "+globalObject);
},1500);
}
@ashanbh
ashanbh / NameSpace.js
Created June 5, 2013 02:58
JQuery NameSpace Declaration
(function(nameSpace) {
//Private Property
var myPrivateProperty = true;
//Private Method
function doSomething( item ) {
if ( item !== undefined ) {
console.log( "Adding " + $.trim(item) );
}
}
@ashanbh
ashanbh / YUI namepace.js
Last active December 18, 2015 02:29
Yahoo namespace function
YAHOO.namespace = function() {
var a=arguments, o=null, i, j, d;
for (i=0; i&lt;a .length; i=i+1) {
d=a[i].split(".");
o=YAHOO; // YAHOO is implied, so it is ignored if it is included
for (j=(d[0] == "YAHOO") ? 1 : 0; j&lt;d.length; j=j+1) {
o[d[j]]=o[d[j]] || {};
o=o[d[j]];
}
}
body {
background-image: url('..url to your image..');
background-size: cover;
...
}