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/sh | |
grep -ro "http[^ )>']*" "$1" | grep -v "[{}]" | cut -d: -f 2- | sort | uniq |
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
#include <stdlib.h> | |
#include <time.h> | |
#include <windows.h> | |
#define WIDTH 80 | |
#define HEIGHT 40 | |
#define idx(x, y) ((x)+WIDTH*(y)) |
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/sh | |
set -eu | |
if [ $# = 0 ]; then | |
printf "usage: %s file [opts]\n" "$(basename "$0")" >&2 | |
exit 2 | |
fi | |
f=$1 | |
shift | |
if gpac -i "$f" inspect | grep -q DolbyVision; then | |
set -- -ab dby1 "$@" |
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
/** @type {import('jscodeshift').Transform} */ | |
module.exports = function (file, api) { | |
const j = api.jscodeshift; | |
const root = j(file.source); | |
return root | |
.find(j.CallExpression, { callee: { property: { name: "forEach" } } }) | |
.replaceWith((path) => { | |
const call = path.value; | |
const callee = /** @type {import('jscodeshift').MemberExpression} */ ( |
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/sh | |
set -euo pipefail | |
root= | |
while getopts D: opt; do | |
case $opt in | |
D) root=$OPTARG ;; | |
?) exit 2 | |
esac | |
done |
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
# Add to ~/.profile or ~/.bashrc, etc | |
# Use it like: | |
# vm add ubuntu # or vm add ubuntu custom/ubuntu | |
# vm sh ubuntu | |
# <ctrl-x> to detach from shell | |
# vm sh ubuntu # returns to the same shell | |
# vm stop ubuntu && vm rm ubuntu | |
vm() { | |
case $1 in | |
ls) docker ps -a ;; |
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 | |
# Install | |
# 1. Install dependency: `pip3 install --user pyicloud` | |
# 2. Sign in to iCloud: `icloud --username your@email.com` | |
# 3. Copy file to somewhere in your `PATH` | |
# 4. Add `alias icloud-download="ICLOUD_EMAIL=your@email.com icloud-download"` | |
# to ~/.profile or ~/.bashrc, etc | |
# 5. Use via eg. `icloud-download Documents/folder` | |
# which will download `folder` to your current directory |
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/sh | |
set -euo pipefail | |
dir=~/.ssh/github.com | |
name=$(basename "$0") | |
help=$(printf "\ | |
usage: %s [-d] [repo] |
OlderNewer