Skip to content

Instantly share code, notes, and snippets.

@zfenj
zfenj / brightnessControl.sh
Created September 29, 2019 19:12 — forked from Blaradox/brightnessControl.sh
Notifications for brightness and volume, using dunstify
#!/usr/bin/env bash
# You can call this script like this:
# $ ./brightnessControl.sh up
# $ ./brightnessControl.sh down
# Script inspired by these wonderful people:
# https://github.com/dastorm/volume-notification-dunst/blob/master/volume.sh
# https://gist.github.com/sebastiencs/5d7227f388d93374cebdf72e783fbd6a
@zfenj
zfenj / .aliases
Created August 29, 2019 07:36 — forked from alekratz/.aliases
Pacman aliases
# pacman aliases
alias pac='pacman -S' # install
alias pacu='pacman -Syu' # update, add 'a' to the list of letters to update AUR packages if you use yaourt
alias pacr='pacman -Rs' # remove
alias pacs='pacman -Ss' # search
alias paci='pacman -Si' # info
alias paclo='pacman -Qdt' # list orphans
alias pacro='paclo && sudo pacman -Rns $(pacman -Qtdq)' # remove orphans
alias pacc='pacman -Scc' # clean cache
alias paclf='pacman -Ql' # list files
@zfenj
zfenj / ask.sh
Created July 12, 2019 10:41
Bash General-Purpose Yes/No Prompt Function ("ask")
# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.
ask() {
# https://gist.github.com/davejamesmiller/1965569
local prompt default reply
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
@zfenj
zfenj / Has weird right-to-left characters.txt
Created March 10, 2019 18:27 — forked from endolith/Has weird right-to-left characters.txt
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@zfenj
zfenj / git_repo_info.py
Created March 3, 2019 19:35 — forked from Brimizer/git_repo_info.py
GitPython get current active branch
"""
Depends on GitPython
pip install GitPython
"""
from git import Repo
def get_current_branch_name(repo_path)
"""
Gets the name of the active Git branch as a string.