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
| // Makes a block that should be put at the top-right of a slide in typst. | |
| // Adjust the dy and dx to fit the line length you use, this is set for my default 30pt fontsize. | |
| // Input multiple content blocks to put them side by side. | |
| #let notations = (..contents) => place(top+right, dy: -1.5em, dx: 1.5em, block(inset: 0%, outset: 5pt, fill: red.transparentize(60%), width: 20%*(contents.pos()).len(), height: auto, radius: (bottom-left: 20%))[ | |
| #set align(top+left) | |
| #set text(0.65em) | |
| #set text(0.6em) | |
| #emoji.gear *Notations:* | |
| #stack(dir: ltr, spacing: 1em, ..contents) | |
| ]) |
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
| # --overwrite '*' whereby * means every file path; reinstall everything otherwise you might get "exists in filesystem" errors | |
| pacman -Syyu $(pacman -Qnq) --overwrite '**.so*' |
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
| s/snippet \([^ ]\+\)\(\s\?\)\(\([^ ]* \?\)*\)\(\(\n\t.*\)*\)/snippet \1 "\3"\5\rendsnippet/g | |
| s/\t\(.*\)/\1/g |
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
| #!/bin/bash | |
| # Put thins in your i3 block: | |
| # workspace_command /usr/local/bin/custom_zellij_bar.sh | |
| # Output readale by i3-bar | |
| RESULT="[{ | |
| \"id\": 1, | |
| \"num\": 1, | |
| \"name\": \"<flag>\", |
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
| #let theoremblock(title: [Theorem:], color: green, radius: (top-right: 2pt, bottom-right: 2pt), ..args, body) = { | |
| // The top-title block needs only the | |
| let tr = radius.at( | |
| default: radius.at( | |
| default: radius.at( | |
| default: 0pt, | |
| "right" | |
| ), | |
| "top" | |
| ), |
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
| // A Typst block quote that looks like a `>` syntax sugar in markdown (e.g. github renderer). | |
| // Put on top of relevant files. | |
| #show quote.where(block: true): content => block( | |
| fill: luma(245), | |
| inset: (left: 3%, y: 10%), | |
| radius: (right: 5pt), | |
| stroke: (left: 1pt+luma(100)), | |
| content | |
| ) |
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
| """ | |
| Partially inspired from https://stackoverflow.com/a/70686229 | |
| """ | |
| import torch as pt | |
| def lowtr_circulant(diag: pt.Tensor, dim: int=-1): | |
| r""" | |
| From a vector ``diag``, computes its flipped circular embedding with zeros | |
| above the diagonal. | |
| Can be batched in left dimension(s). |