Skip to content

Instantly share code, notes, and snippets.

View azdanov's full-sized avatar

Anton Ždanov azdanov

View GitHub Profile
@azdanov
azdanov / change_background.fish
Last active January 14, 2024 11:41
Change background in fish automatically
function change_background --argument mode_setting
# https://arslan.io/2021/02/15/automatic-dark-mode-for-terminal-applications/
# change background to the given mode. If mode is missing,
# we try to deduct it from the system settings.
set -l mode "light" # default value
if test -z $mode_setting
set -l val (defaults read -g AppleInterfaceStyle) >/dev/null
if test $status -eq 0
set mode "dark"
@azdanov
azdanov / script.sh
Last active May 13, 2019 05:08
Use ripgrep, xargs in parallel with google-java-format
rg --files -g "*.java" | xargs -P 8 google-java-format -i -a
@azdanov
azdanov / script.sh
Last active September 11, 2020 05:37
List all composer packages
cat composer.json | jq -r '.require | keys[]'
@azdanov
azdanov / format-java.sh
Last active September 11, 2020 05:42
Format to Google style guide
find . -name "*.java" | xargs google-java-format -i