This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # TODO: remove project-specific wording, turn into more generic stuff | |
| # A reusable Dockerfile for building worker images. | |
| # Includes only the worker package, its workspace deps (e.g. flow-utils), and their | |
| # transitive dependencies. Final image contains only the installed venv (no full repo). | |
| # | |
| # Build args: | |
| # WORKER_PACKAGE_NAME - uv package name (e.g. aa_torrents), must match name of a directory in workers/ | |
| ARG WORKER_PACKAGE_NAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import nbformat as nbf | |
| from typing import TypedDict | |
| class CodeCellMeta(TypedDict): | |
| cell_num: int | |
| output_size_bytes: int | |
| first_lines: list[str] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Genius Lyrics Copier | |
| // @namespace genius-lyrics-copier | |
| // @version 1 | |
| // @description Adds a button to copy lyrics from Genius website to clipboard | |
| // @match https://genius.com/* | |
| // @grant GM_setClipboard | |
| // @noframes | |
| // ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jupyter nbconvert --stdout --no-prompt --to script notebook.ipynb | grep -Ev '^\s*\(*[a-zA-Z0-9_\.,\s]+\)*\s*$' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://stackoverflow.com/a/23013726/13727176 | |
| function swap(obj) { | |
| const ret = {}; | |
| for (const key in obj) { | |
| ret[json[key]] = key; | |
| } | |
| return ret; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| snippet imfn | |
| ```{r, echo=F} | |
| # This is a custom function I wrote for showing images | |
| # It is more robust than embedding images in R markdown directly | |
| # With imgs embedded in R markdown, compilation of whole document fails if img missing | |
| # This function also displays the image if possible and just logs an error otherwise | |
| # Under the hood, knitr::include_graphics() is used, which also accepts multiple image paths as parameter | |
| # Therefore, with this function, side-by-side images are also supported | |
| # We then need to pass a vector of paths in the function call and add fig.show='hold' to the code cell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Search for pattern in PDFs inside current folder (and subfolders, recursively) | |
| pdfgrep pattern $(find -name '*.pdf' | sort) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| snippet imfn | |
| ```{r, echo=F} | |
| # This is a custom function I wrote for showing images | |
| # It is more robust than embedding images in R markdown directly | |
| # With imgs embedded in R markdown, compilation of whole document fails if img missing | |
| # This function also displays the image if possible and just logs an error otherwise | |
| # Under the hood, knitr::include_graphics() is used, which also accepts multiple image paths as parameter | |
| # Therefore, with this function, side-by-side images are also supported | |
| # We then need to pass a vector of paths in the function call and add fig.show='hold' to the code cell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"lastUpload":"2021-03-24T16:57:43.413Z","extensionVersion":"v3.4.3"} |