Skip to content

Instantly share code, notes, and snippets.

# pig -param orig=/user/bcolloran/data/fhrFullDump_2014-01-31/ -param fetchids=/tmp/sample_list.txt -param jointype=merge -param output=DEST_PATH fetch_reports.pig
register '/opt/cloudera/parcels/CDH/lib/pig/piggybank.jar';
fulldump = LOAD '$orig' USING org.apache.pig.piggybank.storage.SequenceFileLoader AS (key:chararray, value:chararray);
ids_to_fetch_raw = LOAD '$fetchids' USING PigStorage() AS (key:chararray, ign:chararray);
ids_to_fetch = ORDER ids_to_fetch_raw BY key;
common = JOIN fulldump by key, ids_to_fetch by key USING '$jointype';
@pmclanahan
pmclanahan / pre-commit
Created May 23, 2014 23:01
Flake8 and jshint pre-commit git hook
#!/bin/sh
exit_code=0
for file in `git diff --cached --name-only --diff-filter=ACM | sort | uniq`
do
if [ ${file: -3} == ".py" ]; then
flake8 --ignore=E121,E123,E124,E125,E126,E127,E128,E501 $file
if [ "$?" -ne "0" ]; then
exit_code=1
@oubiwann
oubiwann / 01-bottle.py
Last active August 29, 2015 14:05
Comparison of Python (Bottle), Clojure (Compojure), and Erlang/LFE (lfest) REST Routes
from example.bottle.bttl import Bottle
app = Bottle()
@app.get('/')
def index():
return "Hello, World!"
@app.get('/orders')
def get_orders():
@erikvold
erikvold / jpm.travis.yml
Last active August 29, 2015 14:07
removing an unecessary line
language: node_js
node_js:
- "0.10"
before_install:
- "export DISPLAY=:99.0"
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 -extension RANDR"
before_script:
- npm install jpm -g
{
"title": "Adapt",
"version": "3.1.4",
"build": true,
"guide": {
"buttons": {
"core": "core button text",
"components": "component button text"
},
"items": [
@potch
potch / style.js
Last active August 29, 2015 14:12
2015 JavaScript Style Guide
// Bad
"Your Framework Sucks."
// Bad
"Browserify? Have you heard about WebPack?"
// Bad
"Ember vs Angular: 10 Things You Should Know"
var ringFunction = function( geometry, radius, segments ) {
var rStep = 2 * Math.PI / segments;
return {
create : function( height, skinIndex, skinWeight ) {
for( var i=0; i < segments; i++ ) {
@pmclanahan
pmclanahan / bedrock-changes.md
Created February 2, 2015 22:39
Bedrock Changes

We're making some changes to how static media (js, css, images, fonts, etc.) is handled in bedrock. The major points are as follows:

Instead of the old media('img/dude.gif'), you'll now use static('img/dude.gif'). It's nearly identical, but you do have to be more careful NOT to include a slash at the beginning of the path. The old way would deal, the new will break.

Replacing the old jingo-minify css('bundle-name') and js('bundle-name') functions are tags. They're functionally identical to the old ones, but look like: {% javascript 'bundle-name' %} and {% stylesheet 'bundle-name' %}.

Speaking of bundles, there is a new syntax for them. We're moving from...

OLD

@phspagiari
phspagiari / README.md
Last active August 29, 2015 14:16
Patch for Deis use LDAP Authentication

PoC: Deis with LDAP/AD Authentication

Requirements

@ianblenke
ianblenke / add-xfleet-conflicts.sh
Created March 10, 2015 18:56
Fix fleet's naive unit count based scheduling of deis application units by resubmitting fleet units with an X-Fleet Conflicts glob
#!/bin/bash -e
tmpdir=/tmp/add-xfleet-conflicts
mkdir -p $tmpdir
fleetctl list-units -fields=unit -no-legend | grep -v -e '@\|deis' | cut -d. -f1-2 | sort | uniq | while read name ; do
max=$(fleetctl list-machines -no-legend | wc -l)
count=$(fleetctl list-units -fields=unit -no-legend | grep -e "^$name" | wc -l)
fleetctl list-units -fields=unit -no-legend | grep -e "^$name" | sort -n | while read service; do
tmpfile=$tmpdir/$service
fleetctl cat $service >| $tmpfile
if ! grep X-Fleet $tmpfile > /dev/null; then