Skip to content

Instantly share code, notes, and snippets.

View emorydunn's full-sized avatar

Emory Dunn emorydunn

View GitHub Profile
@emorydunn
emorydunn / Make Year Group.applescript
Created July 8, 2024 23:45
An script for Capture One which creates monthly collections for the current year.
tell front document of application "Capture One 22"
set theYear to year of (current date) as string
--set theYear to "2012"
-- Make year group
set theYearGroup to make new collection with properties {name:theYear, kind:group}
-- Make month groups
repeat with i from 1 to 12
@emorydunn
emorydunn / Dict+ID.swift
Last active July 28, 2023 19:37
Coordinated Store
//
// Dict+ID.swift
//
//
// Created by Emory Dunn on 7/25/23.
//
import Foundation
import Collections
@emorydunn
emorydunn / finder_icons.fish
Last active March 16, 2023 21:23 — forked from chockenberry/finder_icons.sh
Fish function to toggle Finder icons
function finder_icons --description 'Script to toggle Finder icons'
defaults read com.apple.finder CreateDesktop > /dev/null 2>&1
set enabled $status
switch $argv[1]
case off
if test $enabled -eq 1
osascript -e 'tell application "Finder" to quit'
defaults write com.apple.finder CreateDesktop false
open -a Finder
@emorydunn
emorydunn / emoji.fish
Created November 16, 2022 18:37
A function to download Slack reaction.
function emoji --description 'Download an Emoji from Slack'
set url $argv
# Download the file
wget -q "$url"
# Parse the URL.
# Last component is the filename on the server
# Second to last is the emoji name in Slack
set urlComponents (string split "/" $url)
@emorydunn
emorydunn / WebSocketTaskPublisher.swift
Last active April 19, 2022 19:36
A publisher that delivers the messages from a WebSocket.
//
// WebSocketTaskPublisher.swift
//
//
// Created by Emory Dunn on 5/23/21.
//
import Foundation
import Combine
@emorydunn
emorydunn / led_strip_1.yaml
Last active July 23, 2024 16:36
Sonoff L1 ESPHome Component
esphome:
name: led_strip_1
platform: ESP8266
board: esp8285
includes:
- custom_components/sonoff_l1.h
wifi:
@emorydunn
emorydunn / GPXToGeoJSON.swift
Last active January 8, 2020 02:01
Swift script to Convert GPX files to GeoJSON files for import into Compass
// A Swift script to Convert GPX files to GeoJSON files for import into Compass
// The script takes a single argument, the GPX file, and saves out a matching GeoJSON file
//
// The GeoJSON is meant to be imported into Compass (https://github.com/aaronpk/Compass)
// and thus is not "correct" GeoJSON
import Foundation
/// An object to handle converting a GPX file to GeoJSON
struct GPXtoGeoJSON {
@emorydunn
emorydunn / IncrementCounter.swift
Last active April 3, 2019 01:11
Add a counter to a URL
//
// IncrementCounter.swift
//
// Created by Emory Dunn on 2019-04-01.
//
import Foundation
extension URL {
@emorydunn
emorydunn / acme-cert-dump.py
Last active September 26, 2019 18:16 — forked from JayH5/acme-cert-dump.py
Dump certificates from Traefik's acme.json
#!/usr/bin/env python3
import argparse
import base64
import json
import os
import shlex
import subprocess
import sys
@emorydunn
emorydunn / MQTTRotary.ino
Created December 2, 2018 00:45
Use a rotary phone dial connected to an ESP8266 to send MQTT messages.
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#define wifi_ssid "## SSID ##"
#define wifi_password "## PASSWORD ##"
#define mqtt_server "## SERVER IP ##"
//#define mqtt_user ""
//#define mqtt_password ""