Skip to content

Instantly share code, notes, and snippets.


William Henderson quicklywilliam

View GitHub Profile
quicklywilliam /
Last active Nov 25, 2020
Flask Server for Temperature Sensor and Binary Temperature Threshold Sensor
# Use this along with Home Assistant's RESTful Sensor Platform (
# to create a temperature sensor using a Raspberry Pi and a DS18B20 probe.
# In my case this was being used in a sauna (using a waterproof probe
# so I also wanted a binary sensor that indicated whether the temperature had reached a certain threshold or not.
import os
import glob
import time
View gist:459a7b6c7a415a85392f19564a844f08
ogr2ogr -f GeoJSON test.json "'Centers%20and%20Corridors')&returnGeometry=true&spatialRel=esriSpatialRelIntersects&maxAllowableOffset=38&geometryType=esriGeometryEnvelope&inSR=102100&outFields=*&outSR=4326" OGRGeoJSON
View A Proposal to improve App Store

A Proposal to improve App Store Approvals

Dear Apple,

As developers on the Mac and iOS platforms, we think its time to reflect on Apple's App Store review policies.

There are some wonderful things about the App Stores' protection mechanisms. We believe Apple's policy of not allowing every App on the App Stores, while occasionally problematic, acts overall in the interest of users and high quality software. We're happy that Apple has the ability to delist and remove software that violates user privacy, contains egregious security issues, or otherwise puts users and their data at risk.

That said, we believe that the current policy of manually reviewing App updates places an undue burden on developers, and ultimately harms user experience. It should be reformed.

Reviewing App Updates Harms Developers and Users

quicklywilliam / kudo.bash
Created Sep 22, 2015
Kudo- Use Knock to run a command as root/sudo
View kudo.bash
function kudo {
export fullcmd=""
for i in "$@"; do export fullcmd="$fullcmd '${i}'";done
osascript -s so -e "do shell script \"$fullcmd 2>&1\" with administrator privileges"
quicklywilliam / factorion.swift
Last active Aug 25, 2015
Finds all Base-10 Factorions
View factorion.swift
#!/usr/bin/env swift
// Inspired by @AlgebraFact,
import Foundation
// A factorion is a number that is equal to the sum of the factorials of its digits.
// There are only 4 factorions.
// 1 = 1!
View gist:842859749c5d78251a77
// Props to the fine folks on this thread
// Example output of a call to dailyUsageStasticsForBundleIdentifier or weeklyUsageStasticsForBundleIdentifier
// Inline comments are educated guesses at meaning
// {
// Airdrop = 0; // Has App used Airdrop
// Airplay = 0; // Has App used Airplay
// BBCondition = 0; // ?? BB = Backboard? This number is a float (ie 24.8766038700895)
// // No idea what the below units are, or what BLD means
quicklywilliam / gist:95a8b6a4f8b274b6d775
Last active Jun 29, 2022
Craigslist search query for finding classic steel touring bikes
View gist:95a8b6a4f8b274b6d775
**Tourers (CL appears to have a max query length so you now need to run this search in two parts)**
Part 1:
Part 2:
**Mountain Bikes**
View gist:ed2454efff12e6b4b3a5
Knock 1.1.7 ships with beta support for entering your password into Mac OS X's admin password request dialogs.
To try it out, enter the following command in Terminal. You'll need to restart Knock for these changes to take effect.
defaults write com.knock.mac enableSecurityAgentSupportKey -bool true
To disable it again:
defaults write com.knock.mac enableSecurityAgentSupportKey -bool false
quicklywilliam / gist:6774038
Created Oct 1, 2013
Work around for rdar://problem/15115056 Bug description: If an iOS device has been rebooted and but not yet unlocked, [NSUserDefaults standardUserDefaults] will return nil for any key you've stored. It continues to behave this way even after you unlock the device, until you force quit and relaunch the app.
View gist:6774038
@interface NSUserDefaults (Fix15115056)
- (void)synchronizeAndSetAsUnprotected;
@implementation NSUserDefaults (Fix15115056)
- (void)synchronizeAndSetAsUnprotected;