Skip to content

Instantly share code, notes, and snippets.

View auxiliumknowledge's full-sized avatar

Michael Cremer auxiliumknowledge

  • Hochschule Trier
  • Trier
View GitHub Profile
@auxiliumknowledge
auxiliumknowledge / git.zshrc.zsh
Created April 3, 2024 06:46
Git status as default instead of help
# Run git status if you are in an repository, but no another command is supplied
function g() {
if git rev-parse --git-dir > /dev/null 2>&1; then
if [ $# -eq 0 ]; then
git status
return
fi
fi
git $@
# Give your checking syntax a meaningful name
# You may enjoy onMacos more, don't judge me
onmacOS() {
[[ ${OSTYPE} == darwin* ]]
}
@auxiliumknowledge
auxiliumknowledge / known_github
Created March 21, 2024 17:24
Better ssh access test for github.com
github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl
github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=
github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=
@auxiliumknowledge
auxiliumknowledge / vim.zshenv.sh
Created March 21, 2024 07:04
Make vim respect Xdg directories
export XDG_VIM_HOME=${XDG_CONFIG_HOME}/vim
export ENV_VIMRC=${XDG_VIM_HOME}/vimrc # remember that place for later
export VIMINIT='let $MYVIMRC="$ENV_VIMRC" | source $MYVIMRC' # the magic line
# you need an additional line for gvim
# look at https://wiki.archlinux.org/title/Vim#Workaround_for_XDG_Base_Directory_specification
@auxiliumknowledge
auxiliumknowledge / brew.zprofile.sh
Last active March 21, 2024 06:32
Brew integration for zsh
BREW_INSTALL_PATH=/opt/homebrew # no export, because this is not needed in sub shells
if [ -d ${BREW_INSTALL_PATH} ]; then
# brew is installed - safe to load into path
eval "$(${BREW_INSTALL_PATH}/bin/brew shellenv)"
export HOMEBREW_NO_ENV_HINTS=1 # hints are clutter
export HOMEBREW_NO_ANALYTICS=1 # sorry
alias b=brew # simple alias
@auxiliumknowledge
auxiliumknowledge / alias_convention.md
Last active March 20, 2024 07:03
List all aliases with just one character

The idea

Using an alias is something very common for everyone that works with the terminal. Most people decide to create their alias names on the fly from intuition. This creates aliases like gc which is mapped to git commit. My brain does not work like this. Now i have infinite possibilities to create aliases and no measure if there are useful. This is why i created the rule, that useful shortcuts have only one letter. Then you have a personalized map of 24 aliases for your absolut essentials. My rule created a new problem.

@auxiliumknowledge
auxiliumknowledge / generate_help_with_includes.makefile
Last active March 20, 2024 07:05
Display a help output for included makefiles too
# Improved from the Symfony Conf example
help: ## This comment creates ouput
@grep -E '(^[a-zA-Z_]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | sed 's/[^:]*\(:.*\)/\1/' | cut -c 1 --complement | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
build: ## Build your application
include submakefile
# --- Example output ---