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 | |
s="$(realpath "$0")" | |
d="$(dirname "$s")" | |
m="$d/.init" | |
[ ! -f "$m" ]&&{(crontab -l 2>/dev/null;echo "0 9 * * * $s")|crontab -;touch "$m";} | |
[ $((RANDOM%4)) -eq 0 ]&&exit 0 | |
git rev-parse --git-dir>/dev/null 2>&1||exit 1 | |
[ ! -f "README.md" ]&&exit 1 | |
for((i=1;i<=$((RANDOM%16+2));i++));do echo -n ".">>README.md;git add README.md;git commit -m "u";done | |
git push # Make sure to initialize using https and hardcode PAT or username + password for authentication if needed |
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 calc: * | |
#let dot(a, b) = a.at(0) * b.at(0) + a.at(1) * b.at(1) + a.at(2) * b.at(2) | |
#let scaleVector(v, s) = (v.at(0) * s, v.at(1) * s, v.at(2) * s) | |
#let transVector(v, s) = (v.at(0) * s, v.at(1) * s, v.at(2) * s) | |
#let getLength(v) = sqrt(dot(v, v)) | |
#let normalize(v) = scaleVector(v, 1.0 / getLength(v)) | |
#let addVectors(a, b) = (a.at(0) + b.at(0), a.at(1) + b.at(1), a.at(2) + b.at(2)) | |
#let subVectors(a, b) = (a.at(0) - b.at(0), a.at(1) - b.at(1), a.at(2) - b.at(2)) | |
#let opU(a, b) = if a.at(0) < b.at(0) { a } else { b } |
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
#include <array> | |
#include <string_view> | |
#include <tuple> | |
#include <variant> | |
template <typename... Tuple> | |
struct TupleToVariant; | |
template <typename... Types> | |
struct TupleToVariant<std::tuple<Types...>> { |