Skip to content

Instantly share code, notes, and snippets.

S. Zeid scottywz

View GitHub Profile
@scottywz
scottywz / get-sessionstore-json.js
Created Nov 3, 2018
Get sessionstore JSON for a single Firefox window (including private windows)
View get-sessionstore-json.js
// run in Browser Console (Ctrl+Shift+J; ≡ menu → Web Developer → Browser Console)
// then right click on the JSON output and click Copy object
// use (eg.) <https://code.s.zeid.me/bin/blob/master/sessionstore2html> to convert to HTML
SessionStore.getWindowState(window);
@scottywz
scottywz / 80-udisks2-ignore-loop.rules
Last active Oct 6, 2018
udev rules file to make udisks ignore loop devices
View 80-udisks2-ignore-loop.rules
KERNEL=="loop*", ENV{UDISKS_IGNORE}="1"
View superrightclickd
#!/bin/sh
# Thanks to Zorawar on unix.stackexchange: <https://unix.stackexchange.com/a/202489>
KEYBOARD_ID=12 # from `xinput list`
press="key press "
release="key release"
@scottywz
scottywz / index.php
Created Nov 1, 2015
allow Minecraft Overviewer output in a custom directory to be accessed from another directory within the same document root
View index.php
<?php
$base = "out";
$files = [
"index.html" => function($s) use ($base) {
$s = str_replace("<head>", "<head>\n\n<base href=\"$base/\" />", $s);
$s = str_replace("\"overviewer.js\"", "\"../?overviewer.js\"", $s);
return $s;
},
View messenger-blink.user.js
@scottywz
scottywz / .I <3 Nim. # .md
Last active Aug 29, 2015
.I <3 Nim. — Scott Zeid's Nim playground
@scottywz
scottywz / capplay
Last active Aug 29, 2015
Play deinterlaced video with sound from a video capture card with minimal lag, on GNU/Linux, saveable as raw video and audio in a Matroska container.
View capplay
#!/bin/sh
# Copyright (c) 2014 Scott Zeid.
# Released under the X11 License <https://tldrlegal.com/license/x11-license>.
cap() {
local video=$1
local audio=$2
ffmpeg \
-f v4l2 -i "$video" \
View TMPpref.txt
tabmixplus
browser.ctrlTab.previews=true
browser.link.open_newwindow=3
browser.link.open_newwindow.override.external=-1
browser.link.open_newwindow.restriction=2
browser.newtab.url=about:newtab
browser.search.context.loadInBackground=false
browser.search.openintab=false
browser.sessionstore.interval=15000
browser.sessionstore.max_tabs_undo=10
View joke_sorts.py
#!/usr/bin/env python2
import random
import re
import threading
import time
import sys
class JokeSorts:
@classmethod
View numbers.py
#!/usr/bin/env python
import sys
STRINGS = dict(
negative = ["negative"],
base = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight",
"nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen",
"sixteen", "seventeen", "eighteen", "nineteen"],
tens = ["twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"],
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.