This file contains 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/bin/env python3 | |
import collections | |
from typing import List | |
import datetime | |
import distutils.spawn | |
import hashlib | |
import json |
This file contains 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 | |
TARGETDIR=$1 | |
if [ "$TARGETDIR" = "" ]; then | |
TARGETDIR=$(python -c 'import os; print os.path.realpath("local")') | |
fi | |
mkdir -p $TARGETDIR | |
libevent() { | |
curl -LO https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz | |
tar -zxvf libevent-2.0.22-stable.tar.gz |
This file contains 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/bin/env python3 | |
from collections import OrderedDict | |
from urllib.parse import urlencode | |
import json | |
import re | |
import subprocess | |
import sys | |
import argparse |
This file contains 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
from argparse import ArgumentParser | |
cli = ArgumentParser() | |
subparsers = cli.add_subparsers(dest="subcommand") | |
def argument(*name_or_flags, **kwargs): | |
"""Convenience function to properly format arguments to pass to the | |
subcommand decorator. |
This file contains 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/bin/env python3 | |
import collections | |
import logging | |
import sys | |
import os | |
class ColorizedStreamHandler(logging.StreamHandler): | |
def __init__(self): |
This file contains 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 differenceInBusinessDays from 'date-fns/differenceInBusinessDays'; | |
import parse from 'date-fns/parse'; | |
import toDate from 'date-fns/toDate'; | |
export default { | |
differenceInBusinessDays, | |
parse, | |
toDate | |
}; |
This file contains 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/bin/env bash | |
if ! command -v inkscape &> /dev/null; then | |
echo "command 'inkscape' could not be found" | |
exit 1 | |
fi | |
height=$1 | |
if [[ "$height" -lt 1 ]]; then | |
echo "$height must be greater than 0" |
This file contains 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
(function() { | |
sessionStorage.clear(); | |
const targetNode = document.querySelector('.unredeemed-keys-table'); | |
if (!targetNode) { | |
return; | |
} | |
const config = { attributes: true, childList: true, subtree: true }; | |
const steamRegex = /\S{5}-\S{5}-\S{5}(-\S{5}-\S{5})?/; | |
const extract = (mutationsList, observer) => { |
This file contains 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
# from: https://github.com/stedolan/jq/issues/104 | |
# more explicit (per value) | |
walk( | |
if type == "object" then | |
with_entries( | |
select( | |
.value != null and | |
.value != "" and | |
.value != [] and |
This file contains 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
# ported from https://github.com/junegunn/fzf/wiki/examples#git | |
function glog --description 'git log + fzf + delta => returns git_sha' | |
set -lx git_dir (git rev-parse --git-dir 2> /dev/null) | |
if test -n "$git_dir" | |
set -l EXTRACTED_SHA "echo {} | head -1 | cut -d' ' -f1" | |
set -l VIEW_LINE "$EXTRACTED_SHA | xargs -I % sh -c 'git show --color=always % | delta'" | |
set -l FORMAT "%C(auto)%h%d %s %C(black)%C(bold)%cr% C(auto)%aE" | |
set -l commit_sha (git log --color=always --format="$FORMAT" $argv \ | |
| fzf --no-sort --reverse --tiebreak=index --no-multi --ansi --preview="$VIEW_LINE" \ | |
| cut -d' ' -f1) |