Skip to content

Instantly share code, notes, and snippets.

View fijimunkii's full-sized avatar
🦁
𐂃͠

Harrison Powers fijimunkii

🦁
𐂃͠
View GitHub Profile
@fijimunkii
fijimunkii / index.html
Created March 14, 2017 16:17 — forked from ZJONSSON/index.html
New York Traffic - Live
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<a style="font-size:10px" href="http://nyctmc.org/">Source: nyctm.org</a><br>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
var cams = [252,263,644,494,200,489,488,486,485,484,487,261,251,102,491,258,497,400,203,430,431,290,429,428,432,305,466,299,465,446,448,304,401,447,440,439,444,443,441,355,354,352,350,349,468,469,455,424,425,427,281,551,335,116,434,550,105,106,285,286,438,337,194,348,548,538,547,530,524,536,523,527,526,517,532,535,539,529,528,521,531,537,525,519,533,318,325,324,339,340,445,464,496,341,178,143,166,442,643,642,641,419,329,330,420,421,426,202,201,635,481,127,108,269,268,266,609,509,508,505,504,503,506,502,510,279,280,140,163,603,604,605,606,611,459,457,458,453,500,495,175,173,188,247,615,616,450,483,482,303,302,294,182,157,129,264,570,571,572,555,560,562,564,565,566,563,567,556,569,568,558,573,561,557,191,296,297,467,470,475,111,184,386,397,399,273,613,614,612,122,187,289,186,473,309,492,316,31
@fijimunkii
fijimunkii / mock_aws_configure.sh
Created February 7, 2017 21:37
aws configure for local dev (no creds)
echo -e "testid\ntestkey\nus-east-1\njson" | aws configure
@fijimunkii
fijimunkii / express_cookie_request_reuse_jar.js
Last active May 4, 2017 15:46
reuse req express cookie in request js jar
@fijimunkii
fijimunkii / cherry_pick.sh
Created December 30, 2016 21:16
cherry pick into release
git log # copy the commit number you want
git checkout release
git pull
git cherry-pick commitnumberyoucopied
git push
@fijimunkii
fijimunkii / kube_replace_config_map.sh
Created December 20, 2016 15:41
replace kubernetes config map
kubectl create configmap nginx-lb-config --from-file=nginx-lb.configmap --dry-run -o yaml | kubectl replace configmap nginx-lb-config -f -
@fijimunkii
fijimunkii / clean_kube.sh
Last active December 15, 2016 22:26
remove all kubernetes namespaces and associated items (except kube-system)
for each in $(kubectl get ns -o jsonpath="{.items[*].metadata.name}" | sed -e 's/kube-system//g'); do
kubectl delete ns $each
done
@fijimunkii
fijimunkii / resize-now.js
Last active December 15, 2016 20:25
fully supported window resize trigger
try { window.dispatchEvent(new Event('resize')); } catch(e) {
var evt = window.document.createEvent('HTMLEvents');
evt.initEvent('resize', true, false);
window.dispatchEvent(evt);
}
@fijimunkii
fijimunkii / watchandpush.sh
Last active December 15, 2016 17:38
watch current directory and copy files into kubernetes pod
#!/bin/bash
POD=$1;
NAMESPACE=${2:-default};
echo "Pushing initally to pod $POD";
tar -cpzf - . | kubectl -n $NAMESPACE exec -i $POD -- tar -xpzf - .;
while [[ true ]]
do
if [[ `find . -type f -mtime -3s \( ! -iname ".*" \)` ]]; then
@fijimunkii
fijimunkii / elasticdump_all_indices.sh
Created December 2, 2016 23:30
elasticdump all indices
INPUT=$1
DEST=$2
indices=$(curl -s -XGET $INPUT/_cat/indices?h=i)
for INDEX in $indices
do
elasticdump --input=$INPUT/$INDEX --output=$DEST/$INDEX --type=data
done
@fijimunkii
fijimunkii / prThanks.js
Last active December 2, 2016 23:31
github pr thanks bookmarklet
javascript:(function() { document.getElementById('new_comment_field').value = Array.from(new Set([].concat.apply([],document.querySelectorAll('.js-discussion .author')).map(d => d.innerText))).filter(d => (d!=='fijimunkii')).reduce((o,d) => { o+=' @'+d; return o; }, 'Thanks'); })()