πΎ
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
from munch import Munch | |
# Validates annotations | |
# Adding extra fields is allowed | |
# | |
# class Foo(Base): | |
# a: str | |
# b: int | |
# | |
# foo = Foo(a="hello", b=42, c=True) # This is OK! |
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
from fabric import Connection | |
from scp import SCPClient | |
import paramiko | |
# Wraps commands in bash.exe calls | |
# Also fixes scp problem | |
class WindowsConnection(Connection): | |
_default_bash_path = "C:/Program Files/Git/bin/bash.exe" | |
def resolve_connect_kwargs(self, connect_kwargs): |
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
curl -s "https://api.github.com/users/overengineer/repos?per_page=1000" | jq -r '.[] | [ .html_url, .full_name ] | @sh' | xargs -n 2 git clone |
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
#!/usr/bin/env bash | |
# Caution: It can break | |
# Bash unofficial strict mode | |
set -euo pipefail | |
IFS=$'\n\t' | |
LANG='' | |
function define() { IFS='\n' read -r -d '' ${1} || true; } |
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 | |
set -euo pipefail | |
MSYS_NO_PATHCONV=0 | |
COL=9 | |
if [[ $# -eq 1 ]]; then | |
COL=$1 | |
fi |
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://gist.github.com/overengineer/ad0a26b7c132c8b68ab530b09d199c99 | |
# Bash unofficial strict mode | |
set -euo pipefail | |
IFS=$'\n\t' | |
LANG='' | |
# Pacify Bash strict mode | |
export GIT_PS1_COMPRESSSPARSESTATE='' | |
export GIT_PS1_OMITSPARSESTATE='' |
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
# Github workflow to compile latex and deploy the pdf to an orphan branch. | |
# The latest compiled pdf is at available at e.g. | |
# https://github.com/dgerosa/reponame/blob/build/filename.pdf | |
# Davide Gerosa (2021) https://github.com/dgerosa | |
name: writeapaper | |
on: [push] | |
jobs: | |
paper: | |
runs-on: ubuntu-latest |
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
# pretty sudo prompt | |
read -r -d '' SUDOPROMPT << EOM | |
πΊπ³πΈπ·π·πΈπ»π·π·πΈπΈπΈπΈπ·πΌπ·π³πΊπΌπΊπΈπ»πΌπΌπ³π³πΌπΊπ»π·ππ·πΌπ»π³πΈπ·π·π»πΈ | |
πΈπ¦π»πΈπ³π·πΈπ·πΈπ³πΈπ»π³ππ»π·π·πΌπ»πΊπΊπ»πΌπ»π»πΌπΊπ»π³πΌπ³πΊπ³π·π»πΌπ·πΌπ»πΈ | |
π³πΈπ»πΊπ»π³πΊπΊπ»πΊπΈπ»π·π·πΌπ»πΊπΌπ»π»π·π³π»πΈπ³π·π»π³π³π³π³πΌπ³π³πΊπ·π³πΊπ³πΊ | |
π¦πΈπ»πΊπΊπ³πΈπΈπΌπ»πΊπΌπ·πΈπ³πΌπΊπΈπΊπ·π»π·πΊπΊπ³π·π·π°πΈπ»π³πΈπΌπ·πΌπ³π·πΉπΌπΊ | |
π·π³π»πΈπΈπΌπ°π·πΊπ·πΊπ»π·πΈπΊπ»π³π»π·π»π»πΊπΈπΈπΊπ»πΈπ»π³π³π»π¦π»πΌπΌπ»π»πΊπ³π° | |
πΌπ¦π»π³πΈπΈπ³π·πΊπΌπ³π·πΈπ»πΌπ»ππ»πΌπ·πΊπΌπΊπΈπΊπ¦π·πΈπ·π»π»πΊπΌπ·ππΈπ·πΌπΈπΉ | |
πΈπ³π»πΌπ»π³πΈπ·πΊπ·π·πΌπ»π·π»πΊπΌπΌπ³πΈπ»π»πΈπΌπΌπΈπ³πΊπ»π»π³πΊπ·π°π»πΌπΉπ·π·π³ | |
πΌπ·π»πΈπΌπ³π»π»π³π·πΌπ»πΊπΊπΊπΊπΊπ³π»πΌπ·πΈπΈπ»πΊπ»π³πΈπ·πΊπΊπΌπΈπΊπ»π»π·πΈπ»π· |
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
chafa <(curl "https://giphy.com/explore/random" | tr -s ' ' '\n' | grep -o '\".*\.gif\"' | sort -R | head -n 1 | xargs curl --output -) |
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/sh | |
# usage: cat "source OneDarkProMonokaiDarker.sh" >> ~/.bashrc | |
if [ "${TERM%%-*}" = 'linux' ]; then | |
# This script doesn't support linux console (use 'vconsole' template instead) | |
return 2>/dev/null || exit 0 | |
fi | |
color00="5c/63/70" | |
color01="f4/47/47" |
NewerOlder