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
View README.md

Setup a new game of cmd-line tag!

Create a new game

sh new-game.sh

sh new-game.sh "Game 1"
@andrewxhill
andrewxhill / cloudflare-ipfs-update.sh
Created Apr 21, 2019
Update an IPFS record in Cloudflare DNS
View cloudflare-ipfs-update.sh
#!/bin/bash
set -e # abort on any error
HASH=${1?param missing - hash.}
echo "Hi $PAGES_CLOUDFLARE_EMAIL"
if [[ -z "${PAGES_CLOUDFLARE_API_KEY}" ]]; then
echo "See setup instructions to set PAGES_CLOUDFLARE_API_KEY"
exit 1
fi
View gateway_test.py
import ipfsapi
import requests
import random
import string
# Gateways
gateways = [
"rx14.co.uk",
"ipfs.deo.moe",
"hardbin.com",
View composable_threads.md
View keybase.md

Keybase proof

I hereby claim:

  • I am andrewxhill on github.
  • I am andrewxhill (https://keybase.io/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() {
super.viewDidLoad()
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters
locationManager.startUpdatingLocation()
View getDestination.swift
class RideFinderViewController: UIViewController {
...
override func viewDidAppear(_ animated: Bool) {
// this view indicates an intent to go someplace
super.viewDidAppear(animated)
// Get the user's likely destinations using the SetSDK
// For custom control of starting location, see: http://bit.ly/getDestinationV1
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: departure.date), let destination = destinations.first {
// Process the top destination predictions
}
}
You can’t perform that action at this time.