Skip to content

Instantly share code, notes, and snippets.

kevin :: Coffee → Code

Kevin Brubeck Unhammer unhammer

kevin :: Coffee → Code
View GitHub Profile
View test.html
h1 {
font-family: Verdana;




  "foo": "bar"
unhammer / wp-email-validate-check.php
Created Mar 17, 2020 — forked from yolabingo/wp-email-validate-check.php
Test Wordpress email validation regular expression
View wp-email-validate-check.php
When using a current PHP version, class-phpmailer.php:validateAddress() uses a complex regex ("pcre8") for email address validation.
PHP < 7.3 uses libpcre 8.x.
PHP 7.3 uses libpcre2 10.x.
Due to a bug in libpcre2 < 10.32-RC1,
this email regex validation fails in PHP 7.3 with PCRE_VERSION < 10.32.
unhammer /
Created Nov 21, 2019
Fix mssql package for Ubuntu 19.10
set -e -u
wget -qO- \
| sudo apt-key add -
echo 'deb [arch=amd64] xenial main' \
| sudo tee /etc/apt/sources.list.d/mssql-server.list
unhammer / vddiff
Last active Dec 14, 2019
little wrapper around `vd --diff` to get diff's -U option, since vd doesn't have a "go to next difference" feature ( )
View vddiff
# Usage:
# $ vddiff -U4 before after -ftsv
# You can toggle between the before/after sheets with Ctrl-^
# If you keyboard layout makes that impossible to type, add an
# alternative binding to your ~/.visidatarc, e.g.
# bindkey("ø", "prev-sheet")
unhammer / showpage.js
Created Sep 27, 2019
Right next to your address bar, make a "New bookmark" with this in, now you can easily remove all those header/footer bars that block your content
View showpage.js
View ical2org.awk
#!/usr/bin/gawk -f
# awk script for converting an iCal formatted file to a sequence of org-mode headings.
# this may not work in general but seems to work for day and timed events from Google's
# calendar, which is really all I need right now...
# usage:
# awk -f THISFILE < icalinputfile.ics >
# Note: change org meta information generated below for author and
# email entries!
unhammer / IDLE with asyncio + imaplib + mbsyncrc
Created Sep 12, 2019 — forked from boris-arzur/IDLE with asyncio + imaplib + mbsyncrc
I use a mail stack based on mbsync & notmuch. I want to run mbsync on new mails. IDLE allows watching efficiently one folder in my mailbox. Async makes is easy to watch a few connections.
View IDLE with asyncio + imaplib + mbsyncrc
import imaplib
import os
import asyncio
loop = asyncio.get_event_loop()
conf = [x.strip().split() for x in open('mbsyncrc')]
unhammer / ad-synopsis.hs
Created Aug 26, 2019
how to get the derivative in Haskell
View ad-synopsis.hs
-- From
:set -package ad
:set -package numbers
:m Numeric.AD Data.Number.Symbolic
diff (\x -> sqrt x) (var "a")
-- 1.0/(2.0*sqrt a)
diff (\x -> x^2 + sqrt x) (var "a")
-- a+a+1.0/(2.0*sqrt a)
diff (\x -> x^2 + sqrt x) 1
unhammer / pidgin2erc.el
Last active Aug 8, 2019
make a fake erc buffer of incoming pidgin chats, so erc-track will show them
View pidgin2erc.el
(defun my-purple-ReceivedImMsg-handler (_num0 nick msg _num1 _num2)
"Handle ReceivedImMsg from Purple dbus service.
NICK and MSG go into an alert, other arguments ignored."
(let ((msg-rendered
(if (fboundp 'libxml-parse-html-region)
(insert msg)
(shr-render-region (point-min) (point-max))
You can’t perform that action at this time.