Skip to content

Instantly share code, notes, and snippets.

View evandcoleman's full-sized avatar

Evan Coleman evandcoleman

View GitHub Profile
@evandcoleman
evandcoleman / gist:5776606
Created June 13, 2013 19:28
Installing Ruby 1.9.3
Install RVM:
\curl -L https://get.rvm.io | bash
Install ruby 1.9.3:
rvm install 1.9.3
Select version:
rvm use ruby-1.9.3
@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",
@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 / 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();
import UIKit
struct AttributedString {
private let _attributedString = NSMutableAttributedString()
private let defaultAttributes: [NSAttributedStringKey: Any]
var attributedString: NSAttributedString {
return NSAttributedString(attributedString: _attributedString)
}

A fix for debugging shared precompiled binaries from Carthage.

error: Couldn't IRGen expression, no additional error

Usage

./build.sh --platform ios MyCoolFramework

@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
//
@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 / 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 / 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