Skip to content

Instantly share code, notes, and snippets.

@snippins
snippins / HUD.py
Last active October 2, 2020 16:01
HUD Menu
#!/usr/bin/python3
import gi
gi.require_version("Gtk", "3.0")
import configparser
import dbus
import dbus.service
import logging
import os
#!/usr/bin/python3
from __future__ import print_function
import re
import signal
import subprocess
import sys
import psutil
from gi.repository import Gio, Gtk, GLib
@snippins
snippins / ff57-tabs-mousewheel.js
Created March 4, 2018 18:18 — forked from benoitryder/ff57-tabs-mousewheel.js
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);
}
@snippins
snippins / surfingkeys.conf
Last active April 25, 2024 16:36
Surfing keys config
settings.smoothScroll = true;
Hints.characters = 'cefhijklmnopqrstuvwxz';
map('<Alt-g>', 'sg');
map('<Alt-i>', 'i');
map('<Alt-;>', 'v');
unmapAllExcept(['<Alt-;>', '/', '<Alt-g>', '<Alt-i>']);
settings.theme = `
@snippins
snippins / nov-grep
Last active September 9, 2020 18:33
(require 'counsel)
(defun my-nov-find-id-of-file (filename)
(interactive)
(let ((i 0)
(dontbreak t))
(while (and (< i (length nov-documents))
dontbreak)
(setq i (1+ i))
(when (string-equal filename (cdr (aref nov-documents i)))
(setq dontbreak nil)
@snippins
snippins / regex-emacs.diff
Last active August 7, 2022 10:49
Emacs 29 patch for regex lookaround - rev b9c65203d0f419306ac062e59a59643db9a1a541 - 2022-08-06 master
diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index 9b2c14c..015451d 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -43,6 +43,8 @@
# undef RE_DUP_MAX
#endif
#define RE_DUP_MAX (0xffff)
+#define PREV_CHAR_BOUNDARY(p, limit) ((p)--)
+#define STRING_CHAR_AND_LENGTH(p, actual_len) ((actual_len) = 1, *(p))