Skip to content

Instantly share code, notes, and snippets.

Avatar

William Henderson quicklywilliam

View GitHub Profile
@quicklywilliam
quicklywilliam / rest_temp.py
Last active Nov 25, 2020
Flask Server for Temperature Sensor and Binary Temperature Threshold Sensor
View rest_temp.py
# 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
View gist:459a7b6c7a415a85392f19564a844f08
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
View A Proposal to improve App Store Approvals.md

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 / 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
quicklywilliam / factorion.swift
Last active Aug 25, 2015
Finds all Base-10 Factorions
View factorion.swift
#!/usr/bin/env swift
// Inspired by @AlgebraFact, https://twitter.com/AlgebraFact/status/636205354544726017
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 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
@quicklywilliam
quicklywilliam / gist:95a8b6a4f8b274b6d775
Last active Aug 20, 2019
Craigslist search query for finding classic steel touring bikes
View gist:95a8b6a4f8b274b6d775
Tourers:
tourismo|Specialissima|520|620|720|Expedition|Sequoia|Voyageur|Passage|Portage|Alyeska|Kodiak|Panasonic|Nishiki|Miyata|Bridgestone|waterford|tour|tourer|touring
Mountain Bikes
stumpjumper|cascade|mb|Highpath|Overbury|ritchey
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
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;
@end
@implementation NSUserDefaults (Fix15115056)
- (void)synchronizeAndSetAsUnprotected;
{