Skip to content

Instantly share code, notes, and snippets.

View overengineer's full-sized avatar
πŸ’Ύ

Alper S. Soylu overengineer

πŸ’Ύ
View GitHub Profile
@overengineer
overengineer / base.py
Last active November 26, 2021 12:37
Flexible Python Dataclass Base using Munch
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!
@overengineer
overengineer / windows.py
Last active April 6, 2022 09:57
Python Fabric Connection Class for Windows
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):
@overengineer
overengineer / clone_all.sh
Created October 12, 2021 18:38
Clone All My Public Repos
curl -s "https://api.github.com/users/overengineer/repos?per_page=1000" | jq -r '.[] | [ .html_url, .full_name ] | @sh' | xargs -n 2 git clone
@overengineer
overengineer / git-json.sh
Last active September 17, 2024 02:22
git log json format
#!/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; }
@overengineer
overengineer / contrib.sh
Last active November 10, 2022 15:31
git contributor stats
#!/bin/bash
set -euo pipefail
MSYS_NO_PATHCONV=0
COL=9
if [[ $# -eq 1 ]]; then
COL=$1
fi
@overengineer
overengineer / .bash_prompt.sh
Last active February 20, 2023 13:54
Emoji Bash Prompt
# 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=''
@dgerosa
dgerosa / writeapaper.yml
Last active May 6, 2023 11:36
Github workflow to compile and deploy latex
# 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
# pretty sudo prompt
read -r -d '' SUDOPROMPT << EOM
πŸŒΊπŸŒ³πŸŒΈπŸŒ·πŸŒ·πŸŒΈπŸŒ»πŸŒ·πŸŒ·πŸŒΈπŸŒΈπŸŒΈπŸŒΈπŸŒ·πŸŒΌπŸŒ·πŸŒ³πŸŒΊπŸŒΌπŸŒΊπŸŒΈπŸŒ»πŸŒΌπŸŒΌπŸŒ³πŸŒ³πŸŒΌπŸŒΊπŸŒ»πŸŒ·πŸ›πŸŒ·πŸŒΌπŸŒ»πŸŒ³πŸŒΈπŸŒ·πŸŒ·πŸŒ»πŸŒΈ
πŸŒΈπŸ¦‰πŸŒ»πŸŒΈπŸŒ³πŸŒ·πŸŒΈπŸŒ·πŸŒΈπŸŒ³πŸŒΈπŸŒ»πŸŒ³πŸŒπŸŒ»πŸŒ·πŸŒ·πŸŒΌπŸŒ»πŸŒΊπŸŒΊπŸŒ»πŸŒΌπŸŒ»πŸŒ»πŸŒΌπŸŒΊπŸŒ»πŸŒ³πŸŒΌπŸŒ³πŸŒΊπŸŒ³πŸŒ·πŸŒ»πŸŒΌπŸŒ·πŸŒΌπŸŒ»πŸŒΈ
🌳🌸🌻🌺🌻🌳🌺🌺🌻🌺🌸🌻🌷🌷🌼🌻🌺🌼🌻🌻🌷🌳🌻🌸🌳🌷🌻🌳🌳🌳🌳🌼🌳🌳🌺🌷🌳🌺🌳🌺
πŸ¦‰πŸŒΈπŸŒ»πŸŒΊπŸŒΊπŸŒ³πŸŒΈπŸŒΈπŸŒΌπŸŒ»πŸŒΊπŸŒΌπŸŒ·πŸŒΈπŸŒ³πŸŒΌπŸŒΊπŸŒΈπŸŒΊπŸŒ·πŸŒ»πŸŒ·πŸŒΊπŸŒΊπŸŒ³πŸŒ·πŸŒ·πŸ°πŸŒΈπŸŒ»πŸŒ³πŸŒΈπŸŒΌπŸŒ·πŸŒΌπŸŒ³πŸŒ·πŸΉπŸŒΌπŸŒΊ
🌷🌳🌻🌸🌸🌼🐰🌷🌺🌷🌺🌻🌷🌸🌺🌻🌳🌻🌷🌻🌻🌺🌸🌸🌺🌻🌸🌻🌳🌳🌻🐦🌻🌼🌼🌻🌻🌺🌳🐰
πŸŒΌπŸ¦πŸŒ»πŸŒ³πŸŒΈπŸŒΈπŸŒ³πŸŒ·πŸŒΊπŸŒΌπŸŒ³πŸŒ·πŸŒΈπŸŒ»πŸŒΌπŸŒ»πŸ›πŸŒ»πŸŒΌπŸŒ·πŸŒΊπŸŒΌπŸŒΊπŸŒΈπŸŒΊπŸ¦”πŸŒ·πŸŒΈπŸŒ·πŸŒ»πŸŒ»πŸŒΊπŸŒΌπŸŒ·πŸŒπŸŒΈπŸŒ·πŸŒΌπŸŒΈπŸΉ
🌸🌳🌻🌼🌻🌳🌸🌷🌺🌷🌷🌼🌻🌷🌻🌺🌼🌼🌳🌸🌻🌻🌸🌼🌼🌸🌳🌺🌻🌻🌳🌺🌷🐰🌻🌼🐹🌷🌷🌳
🌼🌷🌻🌸🌼🌳🌻🌻🌳🌷🌼🌻🌺🌺🌺🌺🌺🌳🌻🌼🌷🌸🌸🌻🌺🌻🌳🌸🌷🌺🌺🌼🌸🌺🌻🌻🌷🌸🌻🌷
@overengineer
overengineer / randomgif
Created December 18, 2020 09:58
Display random GIF on commandline
chafa <(curl "https://giphy.com/explore/random" | tr -s ' ' '\n' | grep -o '\".*\.gif\"' | sort -R | head -n 1 | xargs curl --output -)
@overengineer
overengineer / OneDarkProMonokaiDarker.sh
Last active November 21, 2024 08:45
One Dark Pro Monokai Darker Gnome Terminal Theme
#!/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"