Skip to content

Instantly share code, notes, and snippets.

View trey's full-sized avatar
🐢
Slow and steady

Trey Piepmeier trey

🐢
Slow and steady
View GitHub Profile
@trey
trey / happy_git_on_osx.md
Last active October 9, 2025 17:52
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@trey
trey / LICENSE
Last active August 26, 2025 09:16
Nicely Formatted Anti-Capitalist License
ANTI-CAPITALIST SOFTWARE LICENSE (v 1.4)
Copyright © 2020 Arthur L. Piepmeier III @trey
This is anti-capitalist software, released for free use by individuals and
organizations that do not operate by capitalist principles.
Permission is hereby granted, free of charge, to any person or organization
(the "User") obtaining a copy of this software and associated documentation
files (the "Software"), to use, copy, modify, merge, distribute, and/or sell
@trey
trey / git-commit-author-rewrite.md
Last active August 4, 2025 10:11
Change the email address for a git commit.

Change the email address for a git commit.

$ git commit --amend --author="Author Name <email@address.com>"

or

$ git commit --amend --reset-author
@trey
trey / ghostty.conf
Created March 4, 2025 19:59
Ghosty settings
font-size = 18
font-family = Rec Mono Duotone
shell-integration-features = no-cursor
cursor-color = dodgerblue
cursor-style = block
theme = light:alabaster, dark:afterglow
window-height = 30
window-width = 100
background-opacity = 0.8
background-blur = true
@trey
trey / gist:2555876
Created April 30, 2012 06:00
TextExpander snippet to create a Markdown link with title from URL's title (from clipboard)
#!/usr/bin/env ruby -wKU
require 'open-uri'
# get the clipboard using pbpaste
clip = %x{__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste}
URI.parse(clip).open do |f|
f.each {|l|
if md = (/<title>\s*(.*)\s*<\/title>/iu).match(l) then
@trey
trey / .eleventy.js
Last active January 18, 2025 01:35
Display Image Exif Data in 11ty
const responsiveImage = require('./src/_includes/shortcodes/responsive-image');
const exifData = require('./src/_includes/shortcodes/exif-data');
// …
module.exports = function(eleventyConfig) {
// …
eleventyConfig.addShortcode('responsiveImage', responsiveImage);
@trey
trey / setup-uv.sh
Created October 26, 2024 16:07
convert a project using pip-tools to use uv
while read line; do uv add "$line"; done < requirements/requirements.in
@trey
trey / alpine.html
Last active August 27, 2024 09:33
JavaScript confirmation message with Alpine.js and htmx
<!--
https://alpinejs.dev/directives/on#prevent
https://github.com/alpinejs/alpine/issues/150#issuecomment-580452229
-->
<form x-data action="/something" @submit.prevent="if (confirm('Are you sure?')) $el.submit()" method="post">
<button aria-label="Delete this">[some icon]</button>
</form>
@trey
trey / README.md
Last active May 20, 2024 21:00
Cheat Sheet: J Dilla

I love this playlist so much and I would be sad if it went away. Now I’ll have the track names in any case.

27 hours and 3 minutes of shuffle-friendly goodness.

Howto

  1. In Spotify: select all tracks, copy, then paste them into a text file.
  2. Run shell script (which uses my url script).

Shell script:

@trey
trey / chrome_search_engines.md
Created February 8, 2012 00:29
Use Custom Search Engines in Chrome for Named Bookmarklets

Use Custom Search Engines in Chrome for Named Bookmarklets

One of the things I loved about using Safari was that I could have items in my bookmark bar that I could invoke with ⌘1, ⌘2, etc. This was especially nice for things like bookmarklets. For example, I'm viewing an article that I want to read later, I could hit ⌘2 and save it to [Instapaper][instapaper].

Chrome has no such shortcuts for its bookmark bar, but it does have [custom search engines][search_engines].

The idea behind these is allowing you to set a search engine for something like Amazon and be able to type amazon⇥, enter a search term, and get your results without having to do it by manually typing into a search field on the site.

But it can do so much more.