Skip to content

Instantly share code, notes, and snippets.

@peteroid
peteroid / singleton.js
Last active July 26, 2016 21:32
Node JS Simple Singleton used by require()
var singleton = function () {
// all are public
var someVariable = "some value" // acts like states
var otherVariable = 123 // acts like states
return {
someFunction: function (someArg) {
// expressions go here, change state
return "other value"
},
@peteroid
peteroid / Spark-random-nums.scala
Created July 2, 2016 03:51
Generate random numbers and save to hdfs
import scala.util.Random;
var NUM_SAMPLES = 2000000000;
val count = sc.parallelize(1 to NUM_SAMPLES).map{ _ => Random.nextLong };
var sum = count;for (_ <- 1 to 20){sum = sum ++ count};
sum.saveAsTextFile("hdfs://10.0.72.14:54310/data/big_num_700g.txt");
@peteroid
peteroid / # opencv3 - 2016-04-24_11-38-59.txt
Created April 24, 2016 18:56
opencv3 (homebrew/science/opencv3) on Mac OS X 10.11.4 - Homebrew build logs
Homebrew build logs for homebrew/science/opencv3 on Mac OS X 10.11.4
Build date: 2016-04-24 11:38:59