Skip to content

Instantly share code, notes, and snippets.

View evandcoleman's full-sized avatar

Evan Coleman evandcoleman

View GitHub Profile
@evandcoleman
evandcoleman / floatdb.c
Created March 9, 2026 16:03
The Genius of floatDB
/*
* floatdb.c
*
* I wrote this once. I will not write it again.
*
* "The source is the float. The float is open to all."
*
* — Erik
*/
@evandcoleman
evandcoleman / HandleErrors.swift
Created December 30, 2022 21:37
Super simple error handling in SwiftUI
//
// HandleErrors.swift
// App
//
// Created by Evan Coleman on 12/30/22.
//
import SwiftUI
// MARK: Usage Example/Preview
@evandcoleman
evandcoleman / LoadingButton.swift
Created December 26, 2022 20:37
A button with a progress indicator for SwiftUI
//
// LoadingButton.swift
// App
//
// Created by Evan Coleman on 12/26/22.
//
import SwiftUI
struct LoadingButton<DefaultLabel: View, LoadingLabel: View>: View {
@evandcoleman
evandcoleman / Dockerfile
Last active March 26, 2021 20:34
A simple Twitter bot that post NYC COVID vaccine availability
FROM node:14
WORKDIR /usr/src/app
COPY package*.json ./
ENV NODE_ENV production
RUN npm ci --only=production
COPY . .
@evandcoleman
evandcoleman / MLB.js
Last active April 13, 2023 02:45
Scriptable widget for MLB scores
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-gray; icon-glyph: magic;
const TEAM = "NYY";
/////////////////////////////////////////
//
// Cache
//

A fix for debugging shared precompiled binaries from Carthage.

error: Couldn't IRGen expression, no additional error

Usage

./build.sh --platform ios MyCoolFramework

import UIKit
struct AttributedString {
private let _attributedString = NSMutableAttributedString()
private let defaultAttributes: [NSAttributedStringKey: Any]
var attributedString: NSAttributedString {
return NSAttributedString(attributedString: _attributedString)
}
@evandcoleman
evandcoleman / appletv-now-playing-info.ts
Last active March 15, 2018 17:44
Observing the now playing info of an Apple TV
device.on('nowPlaying', (info: NowPlayingInfo) => {
if (info == null) {
triggerStop();
return;
}
if (info.playbackState == NowPlayingInfo.State.Playing) {
triggerPlay();
} else if (info.playbackState == NowPlayingInfo.State.Paused) {
triggerPause();
@evandcoleman
evandcoleman / OpenCVClassifier.h
Created November 8, 2017 20:46
Facial Detection with OpenCV
//
// Copyright © 2016 Evan Coleman. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@class OpenCVFaceFeature;
#pragma mark -
@evandcoleman
evandcoleman / config.json
Last active September 22, 2017 17:41
An example homebridge-harmony-api configuration.
{
"accessories": [
{
"accessory": "HarmonyDevice",
"name": "Living Room Air Conditioner",
"service": "Fan",
"host": "localhost",
"port": 8282,
"hub_slug": "living-room",
"device_slug": "air-conditioner",