Skip to content

Instantly share code, notes, and snippets.


vados t3hmrman

View GitHub Profile
t3hmrman /
Last active Jul 6, 2021
Small script to bind to VolumeDown wheel on Logitech G930 (or other) Headsets with alsa
#!/bin/env python
# This script assumes a ton of facts about your system:
# 1) You're using a Logitech G930 (you can change this below)
# 2) aplay is installed and available on the PATH
# 3) amixer is installed and available on the path
import subprocess as sp
import re
t3hmrman / test.js
Created Sep 28, 2015
Some random JS code
View test.js
var txt = "This is some example text";
t3hmrman / utf8-quoted-printable-decode.js
Created Nov 16, 2014
Simple UTF-8 Quoted Printable decoder
View utf8-quoted-printable-decode.js
* Decode a UTF-8 quoted printable string into a UTF8 string
* @param {string} str - UTF quoted printable string (ex. "=E8=97=A4=E6=A3=AE")
function utf8QuotedPrintableDecode(str) {
// Grab the ascii bytes separated by "=", trim first/last elements if empty
var asciiHex = str.split(/=+/);
if (asciiHex[0] === "") { asciiHex.shift(); }
if (asciiHex[asciiHex.length - 1] === "") { asciiHex.pop(); }
t3hmrman / moz-reload-mode.el
Last active Feb 23, 2016
Reload firefox on save or modification of a file
View moz-reload-mode.el
(require 'moz)
;; This gist is just a combination of two gists that @nonsequitur thought up in 2010:
;; One-line change was made to support recent emacs requirement of 'provide' function (@ bottom)
;;; Usage
;; Run M-x moz-reload-mode to switch moz-reload on/off in the
;; current buffer.
t3hmrman / fixtures.js
Created May 19, 2014
NodeJS Test fixtures for RethinkDB
View fixtures.js
/* Test fixtures and example objects for various tests to use */
var os = require('os'),
fs = require('fs'),
temp = require('temp'),
u = require('underscore'),
portfinder = require('portfinder'),
child_process = require('child_process'),
Q = require('q'),
rdb = require('rethinkdb'),