Skip to content

Instantly share code, notes, and snippets.

@tpenguinltg
tpenguinltg / wpcom-classic-editor-bookmarklet.html
Last active August 29, 2015 14:17
WordPress.com classic editor bookmarklet
<a href="javascript:window.location.replace(document.getElementsByClassName('switch-to-classic')[0].children[0].href)">Edit in classic editor</a>
@tpenguinltg
tpenguinltg / double-factorial.rkt
Last active August 29, 2015 14:17
Double factorial in Racket
#lang racket (define(f[n(read)])(if(<= n 0)1(* n(f(- n 2)))))(f)
@tpenguinltg
tpenguinltg / yougottold-random.js
Created March 28, 2015 03:01
Random string from /r/YouGotTold
z=(function(t){a=[];w=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null,false);while(n=w.nextNode())a.push(n);return a;})(document.body);alert(z[Math.floor(Math.random()*z.length)].textContent);
@tpenguinltg
tpenguinltg / potato.bf
Last active September 18, 2015 23:21
potato in brainfuck
+[>++++++[>++++++[>+++>+++>+++<<<-]<-]<-]>>>++++.-.>++++++++.>-----------.<.<.
@tpenguinltg
tpenguinltg / open-next-to-current.js
Last active December 8, 2015 22:58
Open blank tab next to current in Firefox/SeaMonkey
newTabIndex = gBrowser.tabContainer.selectedIndex + 1;
newTab = gBrowser.loadOneTab("about:blank", null, null, null, false, false);
gBrowser.moveTabTo(newTab, newTabIndex);
if (gURLBar) gURLBar.focus();
@tpenguinltg
tpenguinltg / us-intl-altgr-numpad.xkb
Created January 13, 2016 06:14
US-International (AltGr dead keys) with virtual numpad (activated with ScrLk)
xkb_keymap {
xkb_keycodes "evdev+aliases(qwerty)" {
minimum = 8;
maximum = 255;
<ESC> = 9;
<AE01> = 10;
<AE02> = 11;
<AE03> = 12;
<AE04> = 13;
<AE05> = 14;
@tpenguinltg
tpenguinltg / eggtimer-pause.user.js
Created April 28, 2016 12:59
Allow pausing in e.ggtimer
// ==UserScript==
// @name E.ggtimer pause
// @namespace tpenguinltg
// @description Enables pausing and resuming E.ggtimer by clicking the page
// @include http://e.ggtimer.com/*
// @version 1.0.0
// @grant none
// ==/UserScript==
Egg.pause = function() {
@tpenguinltg
tpenguinltg / google-search-accesskey.user.js
Created May 10, 2016 00:26
Add accesskey shortcut to Google search
// ==UserScript==
// @name Add accesskey shortcut to Google search
// @namespace tpenguinltg
// @description Adds accesskey+f as shortcut for accessing Google search bar
// @include https://www.google.*
// @version 1
// @grant none
// ==/UserScript==
var searchBar = document.querySelector("input[name=q]");
@tpenguinltg
tpenguinltg / netplugd@.service
Last active July 20, 2016 15:06
Interface-specific netplugd systemd service file (based on the service file from Fedora)
[Unit]
Description=Netplug Non-Static Network Interface Manager (interface-specific)
Documentation=man:netplugd(8)
After=network.target
[Service]
ExecStart=/sbin/netplugd -F -i %I
[Install]
WantedBy=multi-user.target
@tpenguinltg
tpenguinltg / netplug
Created July 20, 2016 17:29
netplugd script to disable wireless on wired connection
#!/bin/sh
#
# netplug - policy agent for netplugd
#
# Copyright 2003 Key Research, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation. You are forbidden from
# redistributing or modifying it under the terms of any other license,