Skip to content

Instantly share code, notes, and snippets.

View quicklywilliam's full-sized avatar

William Henderson quicklywilliam

View GitHub Profile
@quicklywilliam
quicklywilliam / gist:95a8b6a4f8b274b6d775
Last active June 29, 2022 16:39
Craigslist search query for finding classic steel touring bikes
**Tourers (CL appears to have a max query length so you now need to run this search in two parts)**
Part 1:
tourismo|Specialissima|520|620|720|Expedition|Sequoia|Voyageur|Passage|Portage|Alyeska
Part 2:
Kodiak|Panasonic|Nishiki|Miyata|Bridgestone|waterford|tour|tourer|touring
**Mountain Bikes**
stumpjumper|cascade|mb|Highpath|Overbury|ritchey
@quicklywilliam
quicklywilliam / rest_temp.py
Last active November 25, 2020 18:31
Flask Server for Temperature Sensor and Binary Temperature Threshold Sensor
# Use this along with Home Assistant's RESTful Sensor Platform (https://home-assistant.io/components/sensor.rest/)
# 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 https://www.sparkfun.com/products/11050)
# 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
// Props to the fine folks on this thread http://bbs.iosre.com/forum.php?mod=viewthread&tid=694
//
// 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
ogr2ogr -f GeoJSON test.json "https://www.portlandmaps.com/arcgis/rest/services/Public/BPS_ReadOnly/MapServer/15/query?f=json&where=RECID%20%3E%200%20AND%20Category%20IN%20('Centers%20and%20Corridors')&returnGeometry=true&spatialRel=esriSpatialRelIntersects&maxAllowableOffset=38&geometryType=esriGeometryEnvelope&inSR=102100&outFields=*&outSR=4326" OGRGeoJSON
@quicklywilliam
quicklywilliam / kudo.bash
Created September 22, 2015 23:58
Kudo- Use Knock to run a command as root/sudo
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"
}

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
quicklywilliam / gist:6774038
Created October 1, 2013 04:56
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.
@interface NSUserDefaults (Fix15115056)
- (void)synchronizeAndSetAsUnprotected;
@end
@implementation NSUserDefaults (Fix15115056)
- (void)synchronizeAndSetAsUnprotected;
{
@quicklywilliam
quicklywilliam / gist:6429376
Created September 3, 2013 20:49
A love letter to IOHIDEventQueue
#!/usr/bin/env ruby
require 'rubygems'
FILEPATH = ARGV.shift
text = File.read(FILEPATH)
text.gsub!(/^.*IOHIDEventQueue.c, line: 512.*$\n/, "")
File.open(FILEPATH, 'w') {|file| file.puts text}
  • example
  • example
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