This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Press Alt-/ to insert the last argument from the same line | |
# ex: | |
# type "cp foo", press Alt-/, and it will insert " foo" so that your command will be | |
# cp foo foo | |
# Great when you want to rename a file to a similar name at the same path | |
# (This is different from Alt-. to insert the last arg from the previous command) | |
insertPreviousArg() { | |
echo $LBUFFER | read -A args | |
LAST_CHAR="${${:-$LBUFFER}[-1]}" | |
LAST_ARG="${args[$#args]}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Twitter Cards --> | |
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}"> | |
{% if page.excerpt %}<meta name="twitter:description" content="{{ page.excerpt | strip_html }}">{% endif %} | |
{% if site.owner.twitter %}<meta name="twitter:site" content="@{{ site.owner.twitter }}">{% endif %} | |
{% if author.twitter %}<meta name="twitter:creator" content="@{{ author.twitter }}">{% endif %} | |
{% if page.image.twitter %} | |
<meta name="twitter:card" content="summary_large_image"> | |
<meta name="twitter:image" content="{{ site.url }}/images/{{ page.image.twitter }}"> | |
{% elsif page.image.feature %} | |
<meta name="twitter:card" content="summary_large_image"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'open3' | |
# Copy the SVG from Sketch, then run this | |
# It will clean up the SVG, insert bind:this={whatever} for any objects named `b:whatever` in the svg, | |
# and print out the variables to declare in Svelte | |
# To use: | |
# 1. copy the SVG from Sketch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Center things": { | |
"prefix": "cf", | |
"body": ["align-items: center;", "justify-content: center;"], | |
"description": "Center items in a flex container" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"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": [ |