Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / potato.bf
Last active September 18, 2015 23:21
potato in brainfuck
+[>++++++[>++++++[>+++>+++>+++<<<-]<-]<-]>>>++++.-.>++++++++.>-----------.<.<.
@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>