This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/local/bin/jq -r -f | |
# | |
# Convert arbitrary array of JSON objects into columnar CSV data where each | |
# column corresponds to a unique key path found in any of the objects. | |
# | |
# For example: | |
# | |
# $ echo '[ {"a": 1, "b":{"c":"d"}}, {"e": 42} ]' | csv-ify | |
# "a","b.c","e" | |
# 1,"d", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
set -e | |
remote=${1:-origin} | |
# Determine local HEAD | |
head=$(git symbolic-ref HEAD) | |
# Determine main branch of remote repo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN { | |
while((getline < "/usr/share/dict/words") > 0) { | |
first = substr($0, 1, 1) | |
wordcnts[first]++ | |
words[first,wordcnts[first]] = $0 | |
} | |
srand() | |
} | |
{ | |
len = length($0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
l[NR] = $0 | |
if (length($0) > max) { max = length($0) } | |
} | |
END { | |
while (1) { | |
for (i=1;i<=NR;i++) { | |
for (j=1;j<=width/max;j++) { | |
printf("%-"max"s", l[i]) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import subprocess | |
def lambda_handler(event, context): | |
p = subprocess.Popen(["env"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | |
print p.communicate(json.dumps(event))[0] | |
return p.returncode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.CountDownLatch; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.TimeUnit; | |
public class OOMerHeap { | |
public static void main(String[] args) { |