Skip to content

Instantly share code, notes, and snippets.

View panzi's full-sized avatar

Mathias Panzenböck panzi

View GitHub Profile
@benoitryder
benoitryder / ff57-tabs-mousewheel.js
Last active November 21, 2018 20:39
Change tabs with mousewheel in Firefox 57
// Change tabs with mousewheel
// Run into Browser Toolbox console
var onTabWheel = function(ev) {
if (ev.deltaMode == 1 /* DOM_DELTA_LINE */) {
var idx = gBrowser.tabContainer.getIndexOfItem(gBrowser.selectedTab);
if (ev.deltaY > 0) {
if (idx + 1 < gBrowser.tabs.length) {
gBrowser.selectTabAtIndex(idx + 1);
}
@vphantom
vphantom / example.sh
Last active April 5, 2021 01:39
OpenVPN inside a kernel namespace
#!/bin/bash
#
# Example wrapper script to run an application jailed inside the VPN.
# "myvpn" is the name of my namespace.
#
sudo -E ip netns exec myvpn sudo -E -u lis -- ~/bin/firefox.bin/firefox &
@e7p
e7p / covpass_decode.py
Last active December 14, 2021 23:59
CovPass QR-Code analyzer port in Python
#!/usr/bin/env python3
import sys
import base45
import zlib
import cose.messages.sign1message
from cose.keys import EC2Key
import cbor2
import datetime
import base64
import json
@sampsyo
sampsyo / aliases.py
Created July 11, 2010 20:04
hack for argparse adding subcommand aliases
#!/usr/bin/env python
"""Aliases for argparse positional arguments."""
import argparse
class AliasedSubParsersAction(argparse._SubParsersAction):
class _AliasedPseudoAction(argparse.Action):
def __init__(self, name, aliases, help):
@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */