Skip to content

Instantly share code, notes, and snippets.

View Fifirex's full-sized avatar
🎓
Uni got me like :/

Yash Saraswat Fifirex

🎓
Uni got me like :/
View GitHub Profile
@Fifirex
Fifirex / stfu.sh
Created November 18, 2021 01:17
play/pause Spotify from Terminal
# just stfu
# for that time u just wanna pause without getting out of the zone (who presses the pause button ugh)
# make it executable, add to PATH and use "stfu"
osascript -e 'tell application "Spotify" to playpause'
# that's my big SHELL script.
# kind of a let down.
# yeah I get it.
# sometimes you just expect the solution to be a lot more complicated.
@Fifirex
Fifirex / pre-commit
Last active June 24, 2021 12:21
Reminds you that a specific line should not be committed.
#!/bin/bash
#
# This hook will look for code comments marked '##no-commit'
# - case-insensitive
# - dash is optional
# - there may be a space after the ##
#
noCommitCount=$(git diff --no-ext-diff --cached | egrep -i --count "(@No|\#\#\s?no[ -]?)commit")
if [ "$noCommitCount" -ne "0" ]; then
echo "WARNING: You are attempting to commit changes which include a 'no-commit'."