Skip to content

Instantly share code, notes, and snippets.

View crowdmatt's full-sized avatar

Matthew Moore crowdmatt

View GitHub Profile
@thattommyhall
thattommyhall / emr.sh
Last active December 15, 2015 10:39
Fixing UTF-8 issues in redshift imports with ruby 1.9.3 and elastic mapreduce. The reducer is pretty dumb, tried to get it working with the identity reducer but it didnt work. You might want to add some more cleanup in either the mapper or the reducer to trim text fields that are too big, make sure number fields are exported correctly, NaN vs nu…
./elastic-mapreduce --create --stream \
--input s3n://YOUR_BUCKET/PATH_TO_FILES/ \
--mapper s3n://YOUR_BUCKET/utf8-cleanup.rb \
--reducer s3n://YOUR_BUCKET/utf8-cleanup-reducer.rb \
--output s3n://YOUR_BUCKET/PATH_TO_FILES_CLEANED \
--bootstrap-action "s3n://YOUR_BUCKET/ruby193.sh" \
--debug \
--num-instances 20
@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
@matthewmccullough
matthewmccullough / gist:47267
Created January 15, 2009 05:15 — forked from halbtuerke/gist:31934
Show Git dirty status in your Unix bash prompt (symbols not compatible with CygWin)
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"