Skip to content

Instantly share code, notes, and snippets.

View mchowning's full-sized avatar

Matt Chowning mchowning

View GitHub Profile
@SirensOfTitan
SirensOfTitan / title-override.el
Created July 14, 2021 19:38
Org-roam titles that denote daily
(defun sirensoftitan/org-roam--is-daily-note (path)
"Determine if note at PATH is a daily note."
(when org-roam-dailies-directory
(string-prefix-p
(expand-file-name org-roam-dailies-directory)
(expand-file-name path))))
(defun sirensoftitan/org-roam--map-title (item)
"Map ITEM to a local title name."
(let* ((file-path (nth 1 item))
@hypest
hypest / redux-store_index.js
Last active May 17, 2022 14:40
Gutenberg Redux action logger
function createSimpleLogger( storeName ) {
return ( store ) => ( next ) => ( action ) => {
const result = next( action );
console.log( {
storeName,
action,
result,
} );
return result;
};
@montasaurus
montasaurus / llmc.sh
Last active April 1, 2025 18:40
AI Shell Command Generator
llmc() {
local system_prompt='Output a command that I can run in a ZSH terminal on macOS to accomplish the following task. Try to make the command self-documenting, using the long version of flags where possible. Output the command first enclosed in a "```zsh" codeblock followed by a concise explanation of how it accomplishes it.'
local temp_file=$(mktemp)
local capturing=true
local command_buffer=""
local first_line=true
local cleaned_up=false # Flag to indicate whether cleanup has been run
cleanup() {
# Only run cleanup if it hasn't been done yet