Skip to content

Instantly share code, notes, and snippets.

S. Zeid scottywz

Block or report user

Report or block scottywz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@scottywz
scottywz / tst-separator.url
Last active Feb 8, 2020
Tree Style Tab separator data: URI (public domain / Creative Commons Zero)
View tst-separator.url
data:text/html;charset=utf-8,<html id="separator" data-string="\u2013" data-length="30" data-background="GrayText" data-opacity="0.125"> <link rel="help" href="https://gist.github.com/f4c51606f99e990774133e9eb46905ee" /><script>addEventListener("load", () => { const html = document.documentElement; document.title = JSON.parse(`"${html.dataset.string.replace('"', '\\"')}"`).repeat(Number(html.dataset.length) || 1); const background = document.querySelector("[id='background']"); background.style.background = html.dataset.background || "unset"; background.style.opacity = html.dataset.opacity || "1"; });</script><style>body, [id="background"] { height: 100%; margin: 0; }</style><link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA
@scottywz
scottywz / bw-session.sh
Last active Dec 3, 2019
Shell function to automatically manage the BW_SESSION environment variable for the Bitwarden CLI. Public domain via CC0.
View bw-session.sh
# Shell function to automatically manage the BW_SESSION environment variable
# for the Bitwarden CLI. Public domain via CC0.
# <https://gist.github.com/c0acd6bcafbc8af3dafefc90d1e0765d>
bw() {
local cmd="$1"
[ $# -ge 1 ] && shift || true
if [ x"$cmd" = x"unlock" ] && [ $# -eq 0 ]; then
local session="$(FORCE_COLOR=$(_bw_force_color) _bw_run "$cmd" --raw "$@")"
if [ x"$session" != x"" ]; then
@scottywz
scottywz / 7zt
Last active Jun 23, 2019
Use Vim to browse archives supported by p7zip
View 7zt
#!/usr/bin/env python3
import argparse
import os
import subprocess
import sys
def print_bytes(*values, sep=b" ", end=b"\n", file=sys.stdout.buffer):
first = True
@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" \
You can’t perform that action at this time.