Skip to content

Instantly share code, notes, and snippets.

@jeffkole
jeffkole / fixed.js
Created January 20, 2016 00:17
21 lines of explanation for a change that amounted to swapping the arguments to a `||`.
const errorMessage = this.state.errorMessage || (this.props.error && this.props.error.message);
@jeffkole
jeffkole / oneroom-technical-links.md
Last active August 29, 2015 14:22
A set of links to interesting relevant technology
router.get('/', function (request, response, next) {
if (request.query.next) {
// Properly handled by Express
next(new Error('Error that I nexted'));
}
else if (request.query['throw']) {
// Properly handled by Express
throw new Error('Error that I threw');
}
else if (request.query.asyncNext) {
@jeffkole
jeffkole / KijiBolt.java
Created May 23, 2013 18:05
Storm bolt to write data to a Kiji table.
import backtype.storm.task.OutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.topology.base.BaseRichBolt;
import backtype.storm.tuple.Tuple;
import org.kiji.schema.Kiji;
import org.kiji.schema.KijiURI;
import org.kiji.schema.KijiTable;
import org.kiji.schema.KijiTableWriter;
@jeffkole
jeffkole / gist:4047435
Created November 9, 2012 18:41
Avro IO with different reader and writer schemas
WRITER_SCHEMA = <<-JSON
{ "type": "record",
"name": "User",
"fields" : [
{"name": "username", "type": "string"},
{"name": "age", "type": "int"},
{"name": "verified", "type": "boolean", "default": "false"}
]}
JSON
@jeffkole
jeffkole / gist:1260549
Created October 3, 2011 23:39
Percona-Server 5.1.58 Homebrew Formula
require 'formula'
class PerconaServer < Formula
url 'http://www.percona.com/redir/downloads/Percona-Server-5.1/Percona-Server-5.1.58-12.9/source/Percona-Server-5.1.58.tar.gz'
homepage 'http://www.percona.com/software/percona-server/'
md5 'd5960629d4a3c4b4bdf7e40be6d40525'
def install
# Make sure the var/mysql directory exists
(var+"mysql").mkpath