Skip to content

Instantly share code, notes, and snippets.

Paul Bauer pmbauer

Block or report user

Report or block pmbauer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pmbauer
pmbauer / roam_wp
Last active Jun 5, 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
View build.sh
# switches and options:
# --rm : remove volume
# -v : volume mount build folder
# -w : set work area to build folder
# /bin/sh : build script
docker run --rm \
-v $(pwd):/go/src/github.com/udacity/my-awesome \
-w /go/src/github.com/udacity/my-awesome \
golang:1.5-alpine \
/bin/sh -c 'apk add --update git; go get; go build -o target/my-awesome .'
View 1.0.dockerfile
FROM alpine:3.3
COPY target/my-awesome /usr/local/bin/my-awesome
CMD ["my-awesome"]
You can’t perform that action at this time.