Skip to content

Instantly share code, notes, and snippets.

Andrew W. Hill andrewxhill

Block or report user

Report or block andrewxhill

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

Setup a new game of cmd-line tag!

Create a new game


sh "Game 1"
andrewxhill /
Created Apr 21, 2019
Update an IPFS record in Cloudflare DNS
set -e # abort on any error
HASH=${1?param missing - hash.}
if [[ -z "${PAGES_CLOUDFLARE_API_KEY}" ]]; then
echo "See setup instructions to set PAGES_CLOUDFLARE_API_KEY"
exit 1
import ipfsapi
import requests
import random
import string
# Gateways
gateways = [

Keybase proof

I hereby claim:

  • I am andrewxhill on github.
  • I am andrewxhill ( on keybase.
  • I have a public key ASCQCpQbOhKgXK6xK9-Xo-2vx_oQgf9v6vW7q6S_ry6FFgo

To claim this, I am signing this object:

View subscribeContext.swift
SetSDK.register(context: beforeCommute) { event as
// Send new information or an opportunity that will be valuable
let content = UNMutableNotificationContent()
content.title = "Weather Alert!"
// ...
View beforeMorningCommute.swift
let beforeCommute = SetSDK.Context(
notificationTiming: .upon,
eventAction: .exit,
eventState: .place(type: .home),
timeOfDay: .morning
View getDestintation.swift
class RideFinderViewController: UIViewController, CLLocationManagerDelegate {
let locationManager = CLLocationManager()
override func viewDidLoad() {
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters
View getDestination.swift
class RideFinderViewController: UIViewController {
override func viewDidAppear(_ animated: Bool) {
// this view indicates an intent to go someplace
// Get the user's likely destinations using the SetSDK
// For custom control of starting location, see:
View getDestination.swift
// departure subscription
SetSDK.instance.onDeparture(.home) { departure in
// on departure, predict their likely destination
if let destinations = SetSDK.instance.getDestination(fromLocation: departure.location, fromTimestamp:, let destination = destinations.first {
// Process the top destination predictions
You can’t perform that action at this time.