Skip to content

Instantly share code, notes, and snippets.

@westurner
westurner / install_roblox_studio__with_vinegar_flatpak_for_linux.sh
Last active February 20, 2025 04:15
install_roblox_studio__with_vinegar_flatpak_for_linux.sh
#!/bin/sh
echo "### Install Roblox Studio on Linux with the Vinegar flatpak"
echo "## Vinegar"
echo "- https://vinegarhq.org/"
echo "- https://vinegarhq.org/Installation/index.html"
echo "- https://vinegarhq.org/Configuration/index.html"
type -a flatpak || echo "ERROR: Flatpak not found. You must install flatpak to install Vinegar" && exit 2
// example SVG url: https://jupyter.org/assets/homepage/main-logo.svg
//$x("//*[name()='svg']");
//$x("//*[name()='use']);
//$x("//*[name()='use'][@*[name()='fill']]");
$x("//*[@*[name()='fill']]");
@westurner
westurner / subprocess_Popen_with_logging.py
Last active August 29, 2024 00:56
Patch subprocess.Popen to log args, kwargs, and the cmd string
from functools import partial
class Popen_with_logging(subprocess.Popen):
"""Patch subprocess.Popen to log args, kwargs, and the cmd string"""
def __init__(self, *args, cmdprefix='+', **kwargs):
print = kwargs.get("printfunc",
partial(__builtins__.print, file=sys.stderr))
# print = log.debug ; printfunc=log.debug
if kwargs.get('shell'):
@westurner
westurner / test_demo_taskw.sh
Last active August 17, 2024 01:56
Demo of TaskWarrior (`task`)
#!/bin/sh
# # A demo/test of taskwarrior (`task`)
#
# ## Usage
# ```sh
# ./test_demo_taskw.sh
# ```
# Note: Interactive input is required:
# - [read and] type "yes" or "y"
# - [read and] type "all" to indeed delete all tasks without further prompting
#!/bin/sh
pipx install --include-deps -f ruff black isort mypy bandit pylint autopep8 pyflakes yapf python-lsp-server[all] pylsp-rope pre-commit pre-commit-hooks
@westurner
westurner / forgot_to_check_out_with_recurse_submodules.md
Created September 12, 2023 19:54 — forked from cnlohr/forgot_to_check_out_with_recurse_submodules.md
Git forgot to clone recursively (forgot to check out with recurse submodules)
@westurner
westurner / savings_interest_and_future_value.ipynb
Last active July 13, 2023 23:15
savings_interest_and_future_value.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

From "Options for giving math talks and lectures online" https://news.ycombinator.com/item?id=22539537 :

One option: screencast development of a Jupyter notebook.

Jupyter Notebook supports LaTeX (MathTeX) and inline charts. You can create graded notebooks with nbgrader and/or with CoCalc (which records all (optionally multi-user) input such that you can replay it with a time slider).

Jupyter notebooks can be saved to HTML slides with reveal.js, but if you want to execute code cells within a slide, you'll need to install RISE: https://rise.readthedocs.io/en/stable/

Here are the docs for CoCalc Course Management; Handouts, Assignments, nbgrader: https://doc.cocalc.com/teaching-course-management.html

@westurner
westurner / build_sphinx_docs_with_readthedocs_container.Dockerfile
Last active September 22, 2021 09:47
Build Sphinx docs locally with the ReadTheDocs Docker container
FROM readthedocs/build:latest
## Install system packages
#RUN pip install -U pip
## Install latest pip
#RUN curl -SL https://bootstrap.pypa.io/get-pip.py > get-pip.py
#RUN python ./get-pip.py
## Install dotfiles
ARG uid=1000
ARG user="app"