Skip to content

Instantly share code, notes, and snippets.


Andre LaBranche dreness

Block or report user

Report or block dreness

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dreness /
Last active Dec 16, 2019
Given a set of images in the same format, compute a slideshow order that minimizes image differences between adjacent frames using a bottleneck TSP solver.
#!/usr/bin/env python
import turicreate as tc
import mlrose
import numpy as np
import os
import sys
import IPython
baseDir = "/Users/andre/work/turi/attempts/attempt1"
dreness /
Created Nov 2, 2019
Extract x509 certificates found in xar table of contents
#!/usr/bin/env python3
from xml.etree import ElementTree as ET
from os.path import abspath
from os import getenv
import subprocess
import textwrap
import zlib
import sys
dreness /
Created Oct 23, 2019
Show recent #TCC entries
# ** NOTE: probably requires that SIP is disabled **
# To show all entries, remove "limit 10" from the queries.
echo "Recent user TCC entries:"
sqlite3 -line ~/Library/Application\ Support/ "SELECT service, client, allowed, prompt_count, Datetime(last_modified, 'unixepoch') as modified FROM access order by modified desc limit 10;"
echo "\n-----------------------------------------\n"
dreness /
Created Oct 22, 2019
Display 10 most recent notification center #notifications
sqlite3 -line "$(getconf DARWIN_USER_DIR)/" "SELECT Datetime(delivered_date + 978328800, 'unixepoch', 'localtime') as delivered_at,
FROM record
JOIN app
ON app.app_id = record.app_id
ORDER BY delivered_at DESC limit 10;"
dreness / tickref.opy
Last active Oct 14, 2019
Displays overwatch instance stats: ticks dropped, ticks counted, ticks expected
View tickref.opy
#!define TICKS A
#!define COUNTING B
#!define NOW C
#!define STARTLAG D
#!define DROPPED E
#!define EXPECTED F
@Rule "fast assemble"
@Event global
if isAssemblingHeroes():
dreness /
Created Oct 8, 2019
Shell heredocs and related nestings

Zsh: Heredoc inside a command substitution

note the helpful indenting in the prompt

zsh% A=$(
cmdsubst> cat <<EOF
cmdsubst heredoc> boep boewp
cmdsubst heredoc> dootles
cmdsubst heredoc> EOF
dreness / new-trails.overscript
Last active Feb 28, 2020
#overwatch workshop code: trails occasionally buggy
View new-trails.overscript
#!define maxEffects N
#!define spawnEffects A
#!define effectDelay D
#!define effectScale S
#!define lastPosition Q
#!define editMode M
#!define editMutex J
#!define trails E
@Rule "fast setup"
dreness / Uncloned.swift
Created May 1, 2019
Show something mumble mumble APFS cloned files mumble?
View Uncloned.swift
import Cocoa
func unclonedSize(of url: URL) throws -> off_t {
var list = attrlist(bitmapcount: UInt16(ATTR_BIT_MAP_COUNT),
reserved: 0,
commonattr: 0,
volattr: 0,
dirattr: 0,
fileattr: 0,
dreness /
Last active Sep 24, 2019
make a video of a bunch of generated barcodes using #ffmpeg
#!/usr/bin/env python3
# make some barcodes, then use ffmpeg to make a video from the individual frames,
# to see how fast FirebaseML can recognize barcodes through the camera.
# barcode types
# code128 code39 ean ean13 ean14 ean8 gs1
# gtin isbn isbn10 isbn13 issn itf jan pzn upc upca
dreness /
Last active Nov 13, 2019 uses #BeautifulSoup to produce a list of links to #SouthPark episodes
#!/usr/bin/env python3
import json
from beautifulscraper import BeautifulScraper
from pprint import pprint as pp
URL = ""
# a sample item:
You can’t perform that action at this time.