Skip to content

Instantly share code, notes, and snippets.

conda create --name myenv python=3.10.11
conda activate myenv
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
pip install xformers
pip install audiocraft
pip install IPython
@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
@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 / get-image-urls.js
Last active May 6, 2024 11:42
Save images from chrome inspector/dev tools network tab
/* open up chrome dev tools (Menu > More tools > Developer tools)
* go to network tab, refresh the page, wait for images to load (on some sites you may have to scroll down to the images for them to start loading)
* right click/ctrl click on any entry in the network log, select Copy > Copy All as HAR
* open up JS console and enter: var har = [paste]
* (pasting could take a while if there's a lot of requests)
* paste the following JS code into the console
* copy the output, paste into a text file
* open up a terminal in same directory as text file, then: wget -i [that file]
*/