Skip to content

Instantly share code, notes, and snippets.

View tobek's full-sized avatar

Toby Fox tobek

View GitHub Profile
@tobek
tobek / thewindow.sh
Last active June 21, 2023 22:58
Script for keeping your windows and applications handy
#!/bin/bash
usage()
{
cat << EOF
usage: thewindow [OPTIONS] SEARCH_STRING COMMAND
This script will search the X window manager for any open window containing SEARCH_STRING and, if found, will move to the containing desktop, raise that window, and give it focus.
If a matching window on the current desktop is found, that will be focused first instead of any matching windows on other desktops.
@tobek
tobek / rip-dvd-chapters.sh
Created October 19, 2020 23:16
Rip and encode individual titles and chapters from DVD or ISO
#!/bin/bash
set -eo pipefail
shopt -s expand_aliases
alias ffmpeg='ffmpeg -hide_banner'
usage()
{
cat << EOF
@tobek
tobek / README.md
Last active April 3, 2024 15:55
Roam bookmarklet for rich link embeds, read later, and bookmark management

Setup:

  1. Create a browser bookmark (e.g. in bookmarks bar) where the URL is the text in bookmarklet below (open this "raw" link so it's not truncated). Yes it's huge, that's fine. You can name the bookmark "Roam Link" or whatever you like.
    • Alternately, go to this page for easier drag-and-drop bookmarklet setup (GitHub doesn't allow javascript links in gists, sorry)
  2. Go to or create a Roam page called roam/css, and create a CSS code block (``` for code block, then change the language selector dropdown to CSS) and paste the CSS below.

Usage:

  1. On the page you want to create a link embed of, hit the bookmarklet (optional: highlight some text first and it'll be included as a quote)
  2. Go to Roam and paste