Skip to content

Instantly share code, notes, and snippets.

@johnnyeric
johnnyeric / ExcelReading.java
Created August 3, 2016 13:49 — forked from Munawwar/ExcelReading.java
Java - Apache POI - Convert XLS/XLSX to CSV
/*
* Dependencies: Apache POI Library from http://poi.apache.org/
*/
package poi_excels;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
@johnnyeric
johnnyeric / gulpfile.js
Created July 25, 2016 17:28 — forked from mikaelbr/gulpfile.js
Gulp + Browserify + Reactify + OS Notification
var source = require('vinyl-source-stream');
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('browserify');
var reactify = require('reactify');
var watchify = require('watchify');
var notify = require("gulp-notify");
var scriptsDir = './scripts';
var buildDir = './build';
@johnnyeric
johnnyeric / gulpfile.js
Created July 25, 2016 17:17 — forked from Sigmus/gulpfile.js
gulpfile.js with browserify, reactify, watchify and gulp-notify.
var source = require('vinyl-source-stream');
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('browserify');
var reactify = require('reactify');
var watchify = require('watchify');
var notify = require("gulp-notify");
var scriptsDir = './scripts';
var buildDir = './build';
@johnnyeric
johnnyeric / dokku_on_digital_ocean.md
Created July 12, 2016 19:56 — forked from henrik/dokku_on_digital_ocean.md
Notes from running Dokku on Digital Ocean.

My notes for Dokku on Digital Ocean.

Commands

Install dokku-cli (gem install dokku-cli) for a more Heroku-like CLI experience (dokku config:set FOO=bar).

# List/run commands when not on Dokku server (assuming a "henroku" ~/.ssh/config alias)
ssh henroku dokku
ssh henroku dokku config:get my-app
@johnnyeric
johnnyeric / introrx.md
Created June 26, 2016 18:39 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@johnnyeric
johnnyeric / Watcher.java
Created June 16, 2016 20:08 — forked from taichi/Watcher.java
example of java.nio.file.WatchService
package sandbox;
import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE;
import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE;
import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY;
import java.io.IOException;
import java.nio.file.ClosedWatchServiceException;
import java.nio.file.FileSystem;
@johnnyeric
johnnyeric / Analyse.java
Created May 30, 2016 12:31 — forked from leomelzer/Analyse.java
Simple-stupid Sentiment analysis for 1 million tweets.
package analyse;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@johnnyeric
johnnyeric / readline-test.js
Created May 15, 2016 17:29 — forked from SBoudrias/readline-test.js
Node.js Readline and CLI keypress example
var readline = require('readline'),
_ = require('lodash'),
charm = require('charm')(process.stdout),
rl = readline.createInterface(process.stdin, process.stdout);
var selected = 0;
var choices = [
"foo",
"bar",
"javascript",
@johnnyeric
johnnyeric / gist:dd9984e4439b71393f48eb4ae292b842
Created April 11, 2016 00:23 — forked from neumino/gist:6554108
Filtering nested arrays with RethinkDB
r.table("test").filter( function(doc) {
return doc("adresses").contains(function(adress) {
return adress("city").eq("Paris")
})
})
/*
{
@johnnyeric
johnnyeric / AndroidBitmapFromView
Created June 15, 2015 02:52
Android - This method extracts the bitmap from an Android view
public static Bitmap loadBitmapFromView(View view) {
Bitmap bitmap = Bitmap.createBitmap( view.getMeasuredWidth(), view.getMeasuredHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());
view.draw(canvas);
return bitmap;
}