Skip to content

Instantly share code, notes, and snippets.

View jdriscoll's full-sized avatar

Justin Driscoll jdriscoll

View GitHub Profile
@jdriscoll
jdriscoll / feather_oled_demo.ino
Last active November 19, 2017 18:58
Adafruit Feather + OLED Wing demo
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display = Adafruit_SSD1306();
#if defined(ESP8266)
#define BUTTON_A 0
#define BUTTON_B 16

Keybase proof

I hereby claim:

  • I am jdriscoll on github.
  • I am jdriscoll (https://keybase.io/jdriscoll) on keybase.
  • I have a public key whose fingerprint is 019B 34DA 7585 1BA0 84FF AD16 AA0C 4F12 8190 ECAF

To claim this, I am signing this object:

@jdriscoll
jdriscoll / clock.swift
Created August 22, 2016 20:52
5 minute interval clock
// Copyright (c) 2016 Justin Driscoll <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
@jdriscoll
jdriscoll / Queries.sql
Last active August 29, 2015 14:22
Load SQL queries from text file
-- all_things
SELECT * FROM things
-- thing_with_id
SELECT * FROM things WHERE id = :id
@jdriscoll
jdriscoll / Layout.swift
Last active October 28, 2016 14:19
Simple Swift Auto Layout Extensions
//
// Layout.swift
//
// Created by Justin Driscoll on 2/22/15.
//
import UIKit
struct Inset {
let value: CGFloat
@jdriscoll
jdriscoll / build.sh
Created July 25, 2014 14:10
AGVTool wrapper for Xcode projects
#!/usr/bin/env sh
if git diff-index --quiet HEAD --; then
agvtool next-version -all
if [ $# -eq 1 ]
then
agvtool new-marketing-version "$1"
fi
@jdriscoll
jdriscoll / arrayDiff.m
Last active August 29, 2015 14:01
Get differences between two NSArrays (for animating table view changes)
void arrayDiff(NSArray *array1, NSArray *array2, NSSet **objectsToAdd, NSSet **objectsToRemove, NSSet **objectsInBoth) {
if (array1 == nil) {
*objectsToAdd = [NSSet setWithArray:array2];
*objectsToRemove = [NSSet set];
*objectsInBoth = [NSSet set];
}
else if (array2 == nil) {
*objectsToAdd = [NSSet set];
*objectsToRemove = [NSSet setWithArray:array1];
//
// XMLObjectMapper.h
// Copyright (c) 2014 Justin Driscoll All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@jdriscoll
jdriscoll / MutableObjInSet.m
Last active August 29, 2015 14:00
Mutable objects in set
#import <Foundation/Foundation.h>
void logIt(NSSet *set) {
NSLog(@"set: %@", set);
for (id object in set) {
NSLog(@"element with hash: %lu", (unsigned long)[object hash]);
}
}
int main(int argc, char *argv[]) {
@jdriscoll
jdriscoll / keybase.md
Last active August 29, 2015 13:58
Proof!

Keybase proof

I hereby claim:

  • I am jdriscoll on github.
  • I am jdriscoll (https://keybase.io/jdriscoll) on keybase.
  • I have a public key whose fingerprint is AFDB 03DF A37F 194A B15B FEB6 A478 146D 9D51 5207

To claim this, I am signing this object: