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"