Skip to content

Instantly share code, notes, and snippets.

View chadmiller's full-sized avatar

Chad chadmiller

View GitHub Profile
@chadmiller
chadmiller / fragment_calculator.xml
Created January 3, 2015 21:41
Android fragment layout doesn't set ID on child when inflated.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Calculator$PlaceholderFragment">
<o.c.TimelineView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/timeline_view" />
# opendns
bogus-nxdomain=67.215.65.132
# Roadrunner
bogus-nxdomain=198.105.244.228
bogus-nxdomain=198.105.251.210
bogus-nxdomain=198.105.254.228
bogus-nxdomain=198.105.254.240
bogus-nxdomain=69.16.143.110
# T-Mobile
bogus-nxdomain=69.16.143.100
#!/bin/bash
# on ubuntu, /etc/network/if-up.d/nxdomain-discovery
set -e -u
test -x /usr/bin/host || exit 0
case "$ADDRFAM" in
inet|inet6) : ;;
*) exit 0 ;;
{
"-81.52" : {
"28.42" : 318,
"28.5" : 486,
"28.31" : 88,
"28.54" : 635,
"28.69" : 676,
"28.7" : 676,
"28.72" : 135,
"28.52" : 635,
kill -KILL $$
set -n
coffee | nose > keyboard
#!/usr/bin/python3
import re
import urllib.request as ur
history = dict()
request = ur.urlopen("http://www.flalottery.com/exptkt/l6.htm")
page_bytes = request.read()
page_characters = page_bytes.decode(request.headers.get_content_charset() or "UTF-8")

Offline GPG

Goals and Overview

Never put secret keys on a machine that reaches the internet. Store daily-use keys in a black box that does crypto for you, and store master key in disconnected offline storage.

@chadmiller
chadmiller / Makefile
Last active May 4, 2016 20:33
Orange County business licenses
#!/usr/bin/make -f
demo: orange-county-business-licenses.sqlite3
sqlite3 $< "select count(*) g, description from business_licenses group by description order by g, description;"
orange-county-business-licenses.sqlite3:
sqlite3 $@ "create table business_licenses (category int not null, account text, businessname text, streetaddress text, citystatezip text, unknown1 int, unknown2 int, unknown3 int, owner text, description text, phonenumber text, licensuredate text);"
set -u; seq 220 |while read weeksago; do wget -nv -O - $$(date +"https://www.octaxcol.com/Octc/Downloads/LocalBusinessTax/Data/%Y-%m-%d.zip" --date "$$weeksago weeks ago Friday") |funzip |sed -e 1d |awk -F, 'BEGIN { OFS=FS } { if ($$11 == "000-000-0000") { $$11=""; } print }' |sqlite3 -bail -stats -cmd '.separator ","' $@ '.import /dev/stdin business_licenses'; done

Keybase proof

I hereby claim:

  • I am chadmiller on github.
  • I am qengho (https://keybase.io/qengho) on keybase.
  • I have a public key whose fingerprint is C2C3 0E6C A4CE D49E 79CF 6C61 A806 DEAC 3042 0066

To claim this, I am signing this object:

xscale, yscale = [7957825782578148e-20,4393119311931213e-20]
xtranslate, ytranslate = [-81.658611,28.346828]
for arc in arcs:
xd, yd = arc.pop(0)
print([(((x+xd)*xscale+xtranslate), ((y+yd)*yscale+ytranslate)) for x, y in arc])