Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Bauer pmbauer

View GitHub Profile
@pmbauer
pmbauer / mono_edit.css
Last active Feb 11, 2022
fixed-width fonts and ligature preservation in edit mode
View mono_edit.css
: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 8, 2022
OCR Templater Script for Obsidian
View OCR.md
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 Jul 22, 2020
roam weekly plan
View roam_wp
#/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/ / /'
}
View flu_cold.pl
% 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
.gitconfig snippet, delete merged branches, restore tab-completion sanity
View .gitconfig
#...
[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 Dec 1, 2017
Advent of Code 2017: Day 01
View day_01.clj
(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 Mar 16, 2018
grease monkey script to highlight personal jobs in the gitlab pipeline view, because linear search is a drag
View gitlab_job_highlighter.js
// ==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==
View JavaIsKindaLight.java
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;
View Dockerfile
FROM alpine:3.4
ARG FOO
ADD test.sh .
RUN ./test.sh
View my-awesome-sizes.txt
udacity/my-awesome 1.0 7.162 MB
udacity/my-awesome big 251.2 MB