Skip to content

Instantly share code, notes, and snippets.

View overengineer's full-sized avatar
💾

Alper S. Soylu overengineer

💾
View GitHub Profile
#!/usr/bin/env python
#******************************************************************************
# $Id: gdal_sieve.py 19392 2010-04-12 18:27:09Z rouault $
#
# Project: GDAL Python Interface
# Purpose: Application for applying sieve filter to raster data.
# Author: Frank Warmerdam, warmerdam@pobox.com
#
#******************************************************************************
@overengineer
overengineer / OneDarkProMonokaiDarker.sh
Last active December 24, 2020 22:35
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"
@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 / .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=''
@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 / git-json.sh
Last active July 20, 2022 14:34
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 / 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 / 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 / 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 / git_branches.sh
Created December 25, 2022 09:27
Git Branches
#!/bin/bash
set -euo pipefail
MSYS_NO_PATHCONV=0
git clean -ffd
git reset --hard 2>/dev/null 1>/dev/null
git checkout dev
# git fsck && git prune && git gc