Skip to content

Instantly share code, notes, and snippets.

Avatar
kevin :: Coffee → Code

Kevin Brubeck Unhammer unhammer

kevin :: Coffee → Code
View GitHub Profile
@Arnavion
Arnavion / ip-flash.awk
Created Nov 18, 2019
Flash Raspberry Pi's IP address using its LED
View ip-flash.awk
#!/usr/bin/awk -f
BEGIN {
while (1) {
split(exec_line_match("ip addr show dev eth0", " inet "), ip_a_parts, " ")
split(ip_a_parts[2], ip_value_parts, "/")
split(ip_value_parts[1], ip_parts, ".")
reset();
@kosmikus
kosmikus / Tutorial.hs
Last active May 1, 2020
Preliminary rewrite of Gabriel's lens tutorial to use `optics` instead of `lens`
View Tutorial.hs
{-| This @lens@ tutorial targets Haskell beginners and assumes only basic
familiarity with Haskell. By the end of this tutorial you should:
* understand what problems the @lens@ library solves,
* know when it is appropriate to use the @lens@ library,
* be proficient in the most common @lens@ idioms,
* understand the drawbacks of using lenses, and:
@yolabingo
yolabingo / wp-email-validate-check.php
Last active May 21, 2020
Test Wordpress email validation regular expression
View wp-email-validate-check.php
<?php
/*
Wordpress bug https://core.trac.wordpress.org/ticket/47855
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 https://bugs.exim.org/show_bug.cgi?id=2300,
@rjhansen
rjhansen / keyservers.md
Last active Jun 14, 2021
SKS Keyserver Network Under Attack
View keyservers.md

SKS Keyserver Network Under Attack

This work is released under a Creative Commons Attribution-NoDerivatives 4.0 International License.

Terminological Note

"OpenPGP" refers to the OpenPGP protocol, in much the same way that HTML refers to the protocol that specifies how to write a web page. "GnuPG", "SequoiaPGP", "OpenPGP.js", and others are implementations of the OpenPGP protocol in the same way that Mozilla Firefox, Google Chromium, and Microsoft Edge refer to software packages that process HTML data.

Who am I?

@unhammer
unhammer / intervec.py
Last active Mar 22, 2018
Multilingual word vectors for SpaCy (based on https://github.com/Babylonpartners/fastText_multilingual )
View intervec.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# A SpaCy implementation of
# https://github.com/Babylonpartners/fastText_multilingual
#
# heavily based on
# https://github.com/Babylonpartners/fastText_multilingual/blob/master/align_your_own.ipynb
import numpy as np
@unhammer
unhammer / signal
Last active Nov 25, 2020
Launch Signal if not running, otherwise toggle hidden/shown state. Put signal.desktop in ~/.config/autostart/.
View signal
#!/bin/bash
run () {
signal-desktop &
disown
}
show () {
local -r id="$1"
idx="$(printf "0x%08x" "${id}")"
@alphapapa
alphapapa / replace-words-randomly.el
Created Jul 24, 2017
Emacs: Replace all words in buffer with random words of the same length
View replace-words-randomly.el
;; This function replaces all words in a buffer with words of the same length,
;; chosen at random from /usr/share/dict/words. Words are replaced consistently,
;; so e.g. "A" is always replaced with "Z". The mapping changes when Emacs is
;; restarted or when the cache buffer is killed. If all unique words of a certain
;; length are exhausted, random strings are used.
(defun ap/replace-words-randomly (&optional buffer)
"Replace all words in BUFFER or current buffer with randomly selected words from the dictionary.
Every time a new word is found, it is mapped to a replacement
word, so every instance of word A will be replaced with word Z."
@unhammer
unhammer / .bashrc_make_wrapper
Last active Feb 16, 2018
a wrapper around `make' to interrupt you when you start procrastinating
View .bashrc_make_wrapper
make ()
{
start=$(date +%s);
command make "$@"
ret=$?
if [[ ${ret} -eq 0 ]]; then
icon=checkbox;
else
icon=computer-fail;
fi;
@unhammer
unhammer / merlin-init.sh
Last active Feb 13, 2021
Create .merlin file for a project with all your ocamlfind packages and .opam sources in there
View merlin-init.sh
#!/bin/sh
if test -f .merlin; then
echo ".merlin already exists, bailing out ..." >&2
exit 1
else
# You could add your default EXT's and such to this list:
@poliveira89
poliveira89 / gist:5966434
Created Jul 10, 2013
How to use WebDav on Linux+XFCE+Thunar
View gist:5966434
davs://poliveira@some.webserver.pt/webdav/someFolder