Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dceddia
dceddia / ck-hide-unsubs.js
Last active February 14, 2022 19:27
Hide unsubscribers in ConvertKit (or replace them with a "% Stayed" instead)
// ==UserScript==
// @name CK - Hide or replace unsubs
// @namespace Violentmonkey Scripts
// @match https://app.convertkit.com/*
// @grant none
// @version 1.0
// @author -
// @description Hides the Unsubscribers number on broadcasts, or replaces it with the percentage of people who stayed.
// ==/UserScript==
@dceddia
dceddia / cknav.js
Created September 29, 2021 13:55
ConvertKit - revert back to the old nav bar.
// ==UserScript==
// @name CK - switch to the old nav
// @namespace Violentmonkey Scripts
// @match https://app.convertkit.com/*
// @grant none
// @version 1.0
// @author -
// @description Changes ConvertKit nav bar back to the old style, where each page has a link
// ==/UserScript==
@dceddia
dceddia / markdown-to-email.sh
Created September 7, 2021 18:05
Drop this in your .zshrc/.bashrc, copy some Markdown to the clipboard, and run `mkemail`. Paste the HTML wherever you want. Requires `pandoc` installed (brew install pandoc).
# Take a Markdown email from the clipboard or a file and turn it into HTML
function mkemail() {
# Either read from clipboard (default) or read from a file
if [[ -z $1 ]]; then
content=`pbpaste`
echo "Reading from clipboard"
else
content=`cat $1`
echo "Reading from file '$1'"
fi
@dceddia
dceddia / double_tap_cmd_to_cmd_l.json
Created July 25, 2021 17:05
Karabiner Elements script to map [double tap left Cmd] to [Cmd+L] (to focus the address bar in Chrome)
{"title": "Rules for Karabiner-Elements",
"rules": [
{ "description": "Press left_command twice to send Cmd+L (Focus Address Bar in Chrome)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_command",
"modifiers": {
"optional": [
@dceddia
dceddia / symbolicate.rb
Created June 26, 2021 18:58
Symbolicate a macOS crash report from Sentry
#!/usr/bin/env ruby
# colorization without needing a gem
class String
def colorize(color_code)
"\e[#{color_code}m#{self}\e[0m"
end
def red
colorize(31)
@dceddia
dceddia / convertkit-top-level-tabs.js
Created April 15, 2021 16:15
A Greasemonkey script to add Sequences and Rules as top-level nav items in ConvertKit
// ==UserScript==
// @name CK - add page links to navbar
// @namespace Violentmonkey Scripts
// @match https://app.convertkit.com/*
// @grant none
// @version 1.0
// @author -
// @description Adds Rules and Sequences to top-level nav
// ==/UserScript==
@dceddia
dceddia / CGPath+svg.swift
Last active July 19, 2023 14:51
Convert a CGPath to an SVG element with this Swift extension to CGPath
//
// CGPath+svg.swift
//
// Create an SVG element from a CGPath.
//
// Created by Dave Ceddia.
// MIT Licensed
//
// Inspired by: https://github.com/mro/MROGeometry/blob/master/MROGeometry/CGPathWriter.c
@dceddia
dceddia / Makefile
Created December 7, 2020 16:34
Build Tailwind
SHELL = /bin/bash
.PHONY: all clean
all: _site/style.css
clean:
rm -rf _site/style.css
_site/style.css: styles/tailwind.css tailwind.config.js | node_modules
@dceddia
dceddia / css.json
Created September 29, 2020 15:03
Put this in VSCode > Preferences > User Snippets > css.json. Then in a CSS file, type "cf" and hit Tab.
"Center things": {
"prefix": "cf",
"body": ["align-items: center;", "justify-content: center;"],
"description": "Center items in a flex container"
}
@dceddia
dceddia / extractHighlightedLines.js
Last active August 26, 2020 22:54
Given a code block, use the first few lines to infer what to highlight when generating syntax-highlighted HTML via Shiki
/* If the block begins with the `highlightLines: []` directive, strip that off,
parse the array as JSON, and pass the lines to Shiki.
Replaces single quotes with doubles, because I know I'm gonna screw that up.
Valid formats include:
highlightLines:[]
highlightLines []
// highlightLines: []