Skip to content

Instantly share code, notes, and snippets.

erjiang / minke_aire.txt
Created Nov 29, 2020
Minke Aire remote command codes
View minke_aire.txt
01010 - toggle light
10010 - toggle light 2
01000 - speed 2
00100 - speed 1
10100 - stop
10000 - speed 3
00010 - reverse
import secrets
import string
from typing import Sequence
This is a set of functions for demonstrating one-time pad
encryption using a twenty-six letter alphabet.
This code is a companion to the article at
# This command can fix timezone offsets for Nikon D850 RAW photos.
# Other vendors may have different date/time metadata.
# the hours offset should be the difference in hours to add to the camera's time
# this should be the location's actual TZ offset
exiftool -ModifyDate+=$HOURS_OFFSET -CreateDate+=$HOURS_OFFSET -OffsetTime=$NEW_OFFSET -OffsetTimeOriginal=$NEW_OFFSET -OffsetTimeDigitized=$NEW_OFFSET -TimeZone=$NEW_OFFSET -DateTimeOriginal+=$HOURS_OFFSET -overwrite_original *.NEF
# Given image files, check the file to see if it has an embedded rating. If it
# does, write it to a RawTherapee sidecar file (.pp3), unless there already is
# a sidecar file.
for FILE in $*
RATING=`exiftool -p '$Rating' $FILE`
if [ "$RATING" -ne "0" -a ! -z "$RATING" ]
View play
# copied from
# Skip DASH manifest for speed purposes. This might actually disable
# being able to specify things like 'bestaudio' as the requested format,
# but try anyway.
# Get the best audio that isn't WebM, because afplay doesn't support it.
# Use "$*" so that quoting the requested song isn't necessary.
erjiang /
Last active Oct 15, 2015 — forked from balrog-kun/
Merge two .osm files, one with building footprints, one with address nodes. Write output.osm.
#! /usr/bin/python2
# vim: fileencoding=utf-8 encoding=utf-8 et sw=4
import sys
import os
import xml.etree.cElementTree as ElementTree
import string
outroot = ElementTree.Element("osm", { "version": "0.6" })
bldgroot = ElementTree.parse(sys.argv[1]).getroot()
View gist:3fbba5cdf7694c06eacd
榮恩 罗恩 [Luo2 en1] /Ron/
赫敏 赫敏 [He4 min3] /Hermione (PRC)/
妙麗 妙丽 [Miao4 li4] /Hermione (Tw)/
格蘭傑 格兰杰 [Ge2 lan2 jie3] /Granger (character from Harry Potter)/
斯内普 斯内普 [Si1 nei4 pu3] /Snape (PRC)/
石內卜 石內卜 [Shi2 nei4 bu3] /Snape (Tw)/
葛來分多 葛来分多 [Ge3 lai2 fen1 duo1] /Gryffindor (Tw)/
鄧布利多 邓布利多 [Deng4 bu4 li3 duo1] /Dumbledore (PRC)/
鄧不利多 邓不利多 [Deng4 bu4 li3 duo1] /Dumbledore (Tw)/
麦格 麦格 [Mai4 ge2] /McGonagall (character from Harry Potter)/
erjiang / .gitconfig
Last active Aug 29, 2015
Eric's git config
View .gitconfig
name = Eric Jiang
email =
editor = vim
branch = auto
diff = auto
status = auto
erjiang / php_get_class.php
Created Jan 9, 2014
PHP inheritance and get_class
View php_get_class.php
class BigClass {
function whatIsThis() {
echo __METHOD__ . ": " . get_class() . "\n";
function whatIsThisNow() {
echo __METHOD__ . ": " . get_class($this) . "\n";
View .hgrc
username = Eric Jiang <>
editor = vim
merge = vimdiff
hgext.graphlog =
pager =
rebase =
color =
transplant =