Skip to content

Instantly share code, notes, and snippets.

@benoitryder
benoitryder / ff57-tabs-mousewheel.js
Last active Nov 21, 2018
Change tabs with mousewheel in Firefox 57
View ff57-tabs-mousewheel.js
// 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);
}
@sampsyo
sampsyo / aliases.py
Created Jul 11, 2010
hack for argparse adding subcommand aliases
View aliases.py
#!/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 Oct 13, 2020
A CSS media query that captures almost all high DPI aware devices.
View high-dpi-media.css
/* ---------------------------------------------------------- */
/* */
/* 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 */
You can’t perform that action at this time.