Skip to content

Instantly share code, notes, and snippets.

(() => {
if (typeof GM_info != 'object' || GM_info.scriptHandler != 'Tampermonkey' || GM_info.version != '4.14') return;
const u_getValue = typeof GM_getValue == 'function' ? GM_getValue : undefined;
const d_getValue = typeof GM == 'object' ? GM.getValue : undefined;
if (u_getValue) {
GM_getValue = this.GM_getValue = (...args) => {
const v = u_getValue(...args);
return JSON.parse(JSON.stringify(v));
@derjanb
derjanb / netpps.sh
Created May 2, 2016 07:43 — forked from joemiller/netpps.sh
shell: quick linux scripts for showing network bandwidth or packets-per-second
#!/bin/bash
if [ -z "$1" ]; then
echo
echo usage: $0 network-interface
echo
echo e.g. $0 eth0
echo
echo shows packets-per-second
// ==UserScript==
// @name Tampermonkey translation support
// @namespace http://tampermonkey.net/
// @version 0.4.1
// @description Tampermonkey translation support
// @match https://github.com/*/tampermonkey-i18n/*
// @require https://code.jquery.com/jquery-2.2.0.min.js
// @updateURL https://gist.github.com/derjanb/5592ff3b7cdc4feabba5/raw/tampermonkey_translation_support.user.js
// @grant GM_xmlhttpRequest
// @domain raw.githubusercontent.com
#!/usr/bin/env python
# Linux usage: ./extract_tampermonkey_script.py "/home/<USER>/.config/<BROWSER>/Default/Local Extension Settings/<EXTENSION_ID>"
# i.e.: ./extract_tampermonkey_script.py "/home/foo/.config/google-chrome-beta/Default/Local Extension Settings/gcalenpjmijncebpfijmoaglllgpjagf"
# Mac usage: ./extract_tampermonkey_script.py "/Users/<USER>/Library/Application Support/Google/Chrome/Default/Local Extension Settings/<EXTENSION_ID>/"
# i.e.: ./extract_tampermonkey_script.py "/Users/foo/Library/Application Support/Google/Chrome/Default/Local Extension Settings/dhdgffkkebhmkfjojejmpbldmpobfkfo/"
import leveldb
import sys
import re
// ==UserScript==
// @name LE
// @namespace http://your.homepage/
// @version 0.1
// @description LE
// @author You
// @match http://tampermonkey.net/empty.html
// @grant unsafeWindow
// ==/UserScript==
# this is a config file for system to recognize WQHD monitor
# put this under /etc/X11/xorg.conf.d/
#
# Intel Graphics's HDMI(or Single-Link DVI) can not output 2560x1440 at 60Hz,
# for its limitation of dot clock
# This file provides settings of 2560x1440 by 55Hz using "reduced blanking"
# Thanks, http://blog.keshi.org/hogememo/2013/08/27/linux-hdmi-wqhd-tips
# and http://www.notebookcheck.net/2560x1440-or-2560x1600-via-HDMI.92840.0.html
Section "Device"
// ==UserScript==
// @name GM_download emulation
// @namespace http://tampermonkey.net/
// @version 0.1
// @description emulate GM_download functionality
// @require https://github.com/eligrey/FileSaver.js/raw/master/FileSaver.js
// @match http://tampermonkey.net/empty.html
// @grant GM_xmlhttpRequest
// @copyright 2014, Jan Biniok
// ==/UserScript==
#!/bin/bash
#Inspired by http://blog.neutrino.es/2012/git-copy-a-file-or-directory-from-another-repository-preserving-history/
#Copy a file or directory out of a git repository, preserving history!
#Creates '/destination/patch/path' with patches that can be applied with git am
#e.g.
#0001-First-Commit.patch
#0002-Second-Commit.patch
#...
#Usage: copy-git-file.sh /some/repo/interesting/thing /destination/patch/path
@derjanb
derjanb / FindInFilesGoto.py
Last active August 29, 2015 14:01
Sublime Text 3 Plugin to jump from the search context and diff files directly to the file
import sublime
import sublime_plugin
import re
import os
# Sublime Text 3 Plugin to jump from the search context and diff files directly to the file
#
# Version 1.1
#
# Taken from skuroda (http://stackoverflow.com/questions/16767732/sublime-text-how-to-jump-to-file-from-find-results-using-keyboard) and extended by derjanb