Skip to content

Instantly share code, notes, and snippets.

View naveenwashere's full-sized avatar
🎯
Focusing

Naveen Kumar K naveenwashere

🎯
Focusing
View GitHub Profile
@thanpolas
thanpolas / test.js
Created April 11, 2013 22:00
Testing promises with mocha
var assert = require('chai').assert;
var when = require('when');
var def1 = when.defer();
function getProm() {
return def1.promise;
}
@gandarez
gandarez / BinaryTreeFindLongestZigZag.cs
Created March 9, 2017 01:10
Find the longest zigzag from a binary tree
class Tree
{
public int x;
public Tree l;
public Tree r;
};
class Task3
{
public int solution(Tree T)
@Shellbye
Shellbye / ubuntu_spark_installer.sh
Last active October 9, 2018 07:58
Install spark 2.1.0 on ubuntu
sudo wget http://d3kbcqa49mib13.cloudfront.net/spark-2.1.0-bin-hadoop2.7.tgz
sudo tar -zxvf spark-2.1.0-bin-hadoop2.7.tgz
cd spark-2.1.0-bin-hadoop2.7
sudo cp conf/log4j.properties.template conf/log4j.properties
sudo sed -i -e 's/INFO/WARN/g' conf/log4j.properties
sudo cp conf/spark-env.sh.template conf/spark-env.sh
sudo cp conf/slaves.template conf/slaves
@cjohansen
cjohansen / gist:739589
Created December 13, 2010 20:55
Showing how to fake server requests with Sinon.JS and Jasmine
/*
Load Sinon.JS in the SpecRunner:
<script type="text/javascript" src="lib/jasmine-1.0.1/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-1.0.1/jasmine-html.js"></script>
<script type="text/javascript" src="sinon-1.0.0.js"></script>
<script type="text/javascript" src="sinon-ie-1.0.0.js"></script>
http://cjohansen.no/sinon/
*/
@giwa
giwa / file0.txt
Last active March 27, 2020 11:31
Install hive on Mac with Homebrew ref: http://qiita.com/giwa/items/dabf0bb21ae242532423
$ brew update
$ brew install hive
@RobertFischer
RobertFischer / Retry.java
Last active July 25, 2020 22:12
A utility method for retrying on exception, using Java 8 lambdas
public class Retry {
private static final Logger log = Logger.getLogger(Retry.class);
public static interface CallToRetry<T> {
<T> T doIt() throws Exception;
}
public static T withRetry(int maxTimes, long initialWait, int waitMultiplier, CallToRetry<T> call) {
if(maxTimes <= 0) {
@bigsnarfdude
bigsnarfdude / gist:b2eb1cabfdaf7e62a8fc
Last active March 8, 2021 09:40
ubuntu 14.04 install scala 2.11.7 and sbt 13.9 and java 8 and git
# scala install
wget www.scala-lang.org/files/archive/scala-2.11.7.deb
sudo dpkg -i scala-2.11.7.deb
# sbt installation
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823
sudo apt-get update
sudo apt-get install sbt
@potench
potench / arcanist.md
Last active November 25, 2021 20:44
Install Phabricator on OSX and Install arcanist

OSX Arcanist Installation Guide

Note, please replace "WWW/tools" with where ever you store your web tools.

$ mkdir ~/WWW/tools
$ cd ~/WWW/tools
$ git clone https://github.com/phacility/libphutil.git
$ git clone https://github.com/phacility/arcanist.git
@martinwicke
martinwicke / automobile.ipynb
Last active January 9, 2022 08:14
Estimator demo using Automobile dataset
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonnyreeves
jonnyreeves / testrunner.html
Created June 2, 2012 13:32
Unit Testing Promises with Sinon.js
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" type="text/css" media="screen" />
<!-- when.js Promises implementation -->
<script src="https://raw.github.com/cujojs/when/master/when.js"></script>
<!-- Unit testing and mocking framework -->
<script type="text/javascript" src="http://code.jquery.com/qunit/git/qunit.js"></script>