Skip to content

Instantly share code, notes, and snippets.

View t-buss's full-sized avatar
🖖
Boldly going

Thomas Buß t-buss

🖖
Boldly going
View GitHub Profile
@t-buss
t-buss / super_i.sh
Last active July 8, 2022 11:26
Create entries to daily log, new Zettelkasten notes in Obsidian or TODOs in a Obsidian Kanban board with Rofi
#!/usr/bin/env bash
set -e
set -o pipefail
function log() {
local CONTENT
CONTENT=$1
DAILY_NOTE_FILENAME=`date +"%Y_%m_%d"`.md
if [[ ! -f $HOME/Repos/obsidian/Reboot/DailyNotes/$DAILY_NOTE_FILENAME ]]; then
@t-buss
t-buss / mq.sh
Created May 15, 2020 18:46
mq - mpd queue: Search YouTube for a music video, then add the track to mpd
#!/usr/bin/env bash
QUERY_RESULT=$(mktemp)
youtube-dl -J -f140 "ytsearch15:$*" | jq ".entries" > $QUERY_RESULT
TITLE=$(jq -r ".[] | .title" $QUERY_RESULT | fzf)
LINK=$(jq -r ".[]
| select(.title==\"$TITLE\")
@t-buss
t-buss / pre-commit
Created July 11, 2018 12:31
Git Hook to not commit to master branch
#!/bin/sh
BRANCH=`git symbolic-ref --short HEAD`
if [ $BRANCH = "master" ]
then
echo "Error: commiting to master is probably not what you want. Create another branch."
exit 1
fi
@t-buss
t-buss / .zshrc
Created February 13, 2018 15:34
Code to send a desktop notification when someone logs into your computer via SSH
if [[ $SSH_CONNECTION ]]; then
notify-send "Incoming SSH connection from `who | tail -n 1 | cut -d'(' -f2 | cut -d')' -f1`"
fi