Skip to content

Instantly share code, notes, and snippets.

body {
/* [...] redacted customizations [...] */
--file-margins: var(--size-4-5);
}
.cm-vimCursorLayer {
animation: none !important;
}
#!/usr/bin/env bash
# NOTE: you will need node installed (for npx asar)
# NOTE: this works on MacOS.
# You'll need to modify MAIN_ASAR and CACHE_DIR for your platform
MAIN_ASAR=/Applications/Obsidian.app/Contents/Resources/obsidian.asar
CACHE_DIR="/Users/$USER/Library/Application Support/obsidian"
@pmbauer
pmbauer / mono_edit.css
Last active February 11, 2022 16:10
fixed-width fonts and ligature preservation in edit mode
:root {
--font-monospace: "MonoLisa", "JetBrains Mono", "Consolas", monospace !important;
--font-family-preview-edit-code: "MonoLisa", "JetBrains Mono", "Consolas", monospace !important;
--text-family-inline-code: "MonoLisa", "JetBrains Mono", "Consolas", monospace !important;
--rb-indent-font-family: "MonoLisa", "JetBrains Mono", "Consolas", monospace !important;
}
/**
* Use fixed-width font for edit mode
*/
@pmbauer
pmbauer / OCR.md
Last active May 14, 2023 02:43
OCR Templater Script for Obsidian
creation date tags
<% tp.file.creation_date() %>
OCR

<%* const supportedFileTypes = ["jpeg", "jpg", "png"]; const images = this.app.vault.getFiles().filter((item) => supportedFileTypes.indexOf(item.extension) >= 0); const target = await tp.system.suggester((item) => item.path, images, true); const out = await tp.user.ocr({ocr_input: target.path});

@pmbauer
pmbauer / roam_wp
Last active July 22, 2020 02:15
roam weekly plan
#/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
roam_date() {
date -d "${*}" '+%B %eXX, %Y' \
| sed -e 's/11XX/11th/; s/12XX/12th/; s/13XX/13th/' \
-e 's/1XX/1st/; s/2XX/2nd/; s/3XX/3rd/' \
-e 's/XX/th/; s/ / /'
}
% flu_cold.pl
% Flu or cold identification example
% Start with ?- go.
go:- hypothesis(Disease),
write('I believe you have: '),
write(Disease),
nl,
undo.
% Hypothesis to be tested
hypothesis(cold):- cold, !.
@pmbauer
pmbauer / .gitconfig
Last active May 11, 2018 18:23
.gitconfig snippet, delete merged branches, restore tab-completion sanity
#...
[alias]
# git gcmerged [master]
gcmerged = "!gcmerged() { trunk=${1:-master}; git branch -D $(git branch --merged ${trunk} | grep -v ${trunk}); git fetch --prune origin; }; gcmerged"
@pmbauer
pmbauer / day_01.clj
Created December 1, 2017 22:45
Advent of Code 2017: Day 01
(def input (->> "1122"
(map #(Integer/parseInt (str %)))
(into [])))
(defn captcha [coll offset]
(transduce (comp (filter #(apply = %))
(map first))
+
(mapv vector coll (->> (cycle coll)
(drop offset)
@pmbauer
pmbauer / gitlab_job_highlighter.js
Last active March 16, 2018 20:54
grease monkey script to highlight personal jobs in the gitlab pipeline view, because linear search is a drag
// ==UserScript==
// @name gitlab pipeline job highlighter
// @namespace http://tampermonkey.net/
// @version 0.1
// @description highlight personal jobs, customize for your url (match)
// @author pmbauer
// @match https://gitlab.ddbuild.io/*/pipelines*
// @grant none
// ==/UserScript==
package pmbauer;
import javax.tools.JavaCompiler;
import javax.tools.ToolProvider;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;