Skip to content

Instantly share code, notes, and snippets.

var elasticsearch = require('elasticsearch');
var client = new elasticsearch.Client();
var eventPattern = /([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) \"(.*?)\" \"(.*?)\" \"(.*?)\" \"(.*?)\" \"(.*?)\"/;
exports.handler = function(data, context) {
var events = [];
var encodedEvent, rawEvent,
matchedEvent, event, i,
commands;
@paulsmith
paulsmith / pre-commit
Created September 4, 2013 20:26
gofmt git pre-commit hook
#!/bin/bash
if git rev-parse HEAD >/dev/null 2>&1; then
FILES=$(git diff --staged --name-only | grep -e '\.go$')
else
FILES=$(git ls-files -c | grep -e '\.go$')
fi
for file in $FILES; do
if test -n "$(gofmt -l $file)"; then
echo "Error: git pre-commit failed, file needs gofmt: $file"
@dryan
dryan / README.md
Last active December 15, 2015 20:19
Python script for deploying files to S3 with multiple deploy environment support. Moved to http://dryan.github.io/d3ploy.