Skip to content

Instantly share code, notes, and snippets.

View ludamillion's full-sized avatar
🕊️

Luke Inglis ludamillion

🕊️
View GitHub Profile
@ludamillion
ludamillion / search-git-history.md
Last active March 6, 2025 12:24 — forked from lyoshenka/search-git-history.md
Search Git commit history for a string and see the diffs

Searching Git commit history

Original Gist

This should be one of the core features of Git, but for some reason it's impossible to figure out how to search for a string in your commit history and see the diffs that that string is in. Here's the best I've come up with:

To find which commits and which files a string was added or removed in:

git log -S'search string' --oneline --name-status

@ludamillion
ludamillion / gist:0711b80fc02f792ec85abdaec7c04248
Created October 17, 2024 13:52 — forked from jackrusher/gist:5139396
Hofstadter on Lisp: Atoms and Lists, re-printed in Metamagical Themas.

Hofstadter on Lisp

In the mid-80s, while reading through my roommate's collection of Scientific American back issues, I encountered this introduction to Lisp written by Douglas Hofstadter. I found it very charming at the time, and provide it here (somewhat illegally) for the edification of a new generation of Lispers.

In a testament to the timelessness of Lisp, you can still run all the examples below in emacs if you install these aliases:

(defalias 'plus #'+)
(defalias 'quotient #'/)
(defalias 'times #'*)
(defalias 'difference #'-)
@ludamillion
ludamillion / svg-preview.el
Created August 26, 2024 13:51 — forked from jackrusher/svg-preview.el
Automatically updating SVG preview in emacs
;; I wrote up a quick + dirty function to get me a preview of the SVG I'm editing:
(defun refresh-svg-preview ()
(interactive)
(let ((oldbuf (current-buffer)))
(with-current-buffer (get-buffer-create "*svg-preview*")
(fundamental-mode)
(erase-buffer)
(insert-buffer-substring oldbuf)
(image-mode))))
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}●%{$fg[white]%}]%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_CLEAN="]%{$reset_color%} "
ZSH_THEME_SVN_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX
ZSH_THEME_SVN_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX
ZSH_THEME_SVN_PROMPT_DIRTY=$ZSH_THEME_GIT_PROMPT_DIRTY
ZSH_THEME_SVN_PROMPT_CLEAN=$ZSH_THEME_GIT_PROMPT_CLEAN
ZSH_THEME_HG_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX
ZSH_THEME_HG_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX
@ludamillion
ludamillion / hammerspoon-init.lua
Created October 26, 2016 15:17 — forked from cabrinha/hammerspoon-init.lua
~/.hammerspoon/init.lua
-- Call up the bar
require("bar")
-- Hotkey mash
local mash = {"cmd", "alt", "ctrl"}
local mash_move = {"cmd", "ctrl"}
hs.alert("Reloaded Config")
@ludamillion
ludamillion / fish-prompt.sh
Created October 20, 2015 13:12 — forked from gak/fish-prompt.sh
My custom fish prompt code explained at http://geraldkaszuba.com/tweaking-fish-shell/
function _common_section
printf $c1
printf $argv[1]
printf $c0
printf ":"
printf $c2
printf $argv[2]
printf $argv[3]
printf $c0
printf ", "