Skip to content

Instantly share code, notes, and snippets.

Avatar

AJ aj-jester

  • Replicated, Inc.
  • Los Angeles, CA
View GitHub Profile
@aj-jester
aj-jester / proxy.js
Created Nov 11, 2016 — forked from nakedible-p/proxy.js
AWS ES proxy
View proxy.js
var AWS = require('aws-sdk');
var http = require('http');
var httpProxy = require('http-proxy');
var express = require('express');
var bodyParser = require('body-parser');
var stream = require('stream');
if (process.argv.length != 3) {
console.error('usage: aws-es-proxy <my-cluster-endpoint>');
process.exit(1);
View lockable_script_boilerplate.sh
#!/bin/bash
## Copyright (C) 2009 Przemyslaw Pawelczyk <przemoc@gmail.com>
## License: GNU General Public License v2, v3
#
# Lockable script boilerplate
### HEADER ###
LOCKFILE="/var/lock/`basename $0`"
@aj-jester
aj-jester / sorted_json.rb
Last active Jan 18, 2018
Puppet parser function that takes unsorted hash and outputs sorted JSON object.
View sorted_json.rb
#
# LICENSE: https://gist.github.com/aj-jester/e0078c38db9eb7c1ef45
#
require 'json'
module JSON
class << self
@@loop = 0
def sorted_generate(obj)