Skip to content

Instantly share code, notes, and snippets.

View Thann's full-sized avatar
✈️
Preserving my Freedom on Gitlab!

Jon Knapp Thann

✈️
Preserving my Freedom on Gitlab!
View GitHub Profile
@Thann
Thann / acunote-dark.css
Created February 19, 2014 23:31
userstyles
tr, #main {
background-color: #a7a7a7 !important;
}
a.issue_number_link {
color: black !important;
}
.task_properties,
.task_properties a {
color: #555;
}
@Thann
Thann / BPM.sh
Last active February 9, 2023 05:11
Beats per minute calculator for the command line.
#!/bin/sh
# Calculates Beats per Minute and confidence.
# Trigger function on ctrl+c
trap ctrl_c_handler INT
function ctrl_c_handler() {
echo -e "\n -> $index beats in $(echo "scale=2; $delta_sum /1"| bc) seconds. "
exit 0
}
@Thann
Thann / jira.prepare-commit-msg
Last active December 23, 2015 00:42
GIT: Prepend the Jira ticket from the branch name to the commit message
#!/bin/sh
#
# Prepend the Jira ticket from the branch name to the commit message
# Do nothing when amending or fixing
if [ -n "$2" ]; then exit 0; fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
TICKET_NAME=$(echo $BRANCH_NAME | grep -Eo "^\w{2}[-_][0-9]+" | awk '{print toupper($0)}')
@Thann
Thann / ev
Created November 6, 2016 20:19
Email Verify
# Verify an email with DKIM
# Usage: ev https://wikileaks.org/podesta-emails/emailid/5205
address=$1
if [ -z $address ] ; then
echo "must pass address!";
exit 1
fi
@Thann
Thann / purse-client.sh
Last active June 12, 2017 23:42
Purse Api Client
#!/bin/env bash
# Purse Api Client
# Usage:
# domain api.purse.io # sets domain, defaults to local.
# login [username] # logs in as user.
# <url> [options] # call out to curl with token.
#
PURSE_CLIENT_TOKEN_FILE="$HOME/.purse_client_token";
@Thann
Thann / keybase.md
Created February 9, 2017 22:53
Keybase proof of identity

Keybase proof

I hereby claim:

  • I am thann on github.
  • I am thann (https://keybase.io/thann) on keybase.
  • I have a public key ASDVh7eIfiuupN1mSj4i-yJrUfL8K4FBkVpC04DjVPWamwo

To claim this, I am signing this object:

@Thann
Thann / Reddit-Sidebar-Toggle.js
Last active April 19, 2017 07:44
Userscript to toggle the reddit sidebar
// ==UserScript==
// @name Reddit Sidebar Toggle
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://*.reddit.com/*
// @grant none
// ==/UserScript==
// Requires RES
@Thann
Thann / 90-user-prefs-thann.sh
Last active August 8, 2017 22:43
xinput user preferences - /etc/X11/xinit/xinitrc.d/
#!/bin/sh
#grep_id() {
# xinput --list | grep $@ | sed "s/.*id=\([0-9]\+\).*/\1/"
#}
# disable touchscreen
xinput --disable "FTSC1000:00 2808:5116"
# disable touchpad while typing
xinput set-prop "ELAN1200:00 04F3:3045 Touchpad" "libinput Disable While Typing Enabled" 1
@Thann
Thann / html_parser.js
Last active July 10, 2019 22:39
Turn HTML into a dict. Each function pulls a value from the document.
#!/usr/bin/env node
// Takes in html and returns a parsed object!
class HTMLParser {
constructor(html, initialValues, extras) {
// Stores values during parsing
const values = initialValues || {};
// Memoize all functions
for (const prop of EveryPropIn( this )) {
@Thann
Thann / btce-trollbox.py
Last active May 16, 2017 04:17
Read the troll-chat from btc-e.com
#!/bin/env python
import re
import sys
import time
import requests
import lxml.html
from functools import reduce
from subprocess import Popen, PIPE
if '-l' in sys.argv: