Skip to content

Instantly share code, notes, and snippets.

# Docker Compose
alias dcf='dcf(){ docker-compose -f docker-compose.${1}.yml ${@:2}; }; noglob dcf' # example: dcf local up -d
# Linux
alias webcam='f(){ if [ $@ = "on" ]; then sudo modprobe uvcvideo; else sudo modprobe uvcvideo -r; fi }; f' # example: webcam off
# Dev
alias browser_automation='f(){ chromium --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server="direct://" --proxy-bypass-list="*" ${1} }; noglob f' # example: browser_automation localhost
# PHP
@coldic3
coldic3 / ecs-pre-push
Created May 4, 2022 07:36
Coding Standard Hook
#!/bin/bash
# .git/hooks/pre-push
files=$(git diff --name-only --cached @{u} || git diff --name-only --cached $(git reflog show --no-abbrev $(git rev-parse --abbrev-ref HEAD) | tail -n1 | awk '{print $1;}')) &> /dev/null;
existingPhpFiles=""
for file in ${files}; do
[ -e "$file" ] && [ `mimetype -b "$file"` == "application/x-php" ] && existingPhpFiles="$existingPhpFiles$file ";
done
@coldic3
coldic3 / README.md
Last active March 31, 2022 12:41
[Experimental] Coding Standard Hook

Coding Standard Hook [Experminetal]

WARNING: May cause file losing.

Dependencies

@coldic3
coldic3 / mic-toggle.sh
Created August 18, 2020 19:01
Mic Toogle
#!/bin/bash
# title: Mic Toggle
# description: Mic Toggle
# author: Kevin Kaniaburka (coldic3)
# requirements: https://github.com/vlevit/notify-send.sh
# notes: Set keyboard shortcut to run this script eg. alt+m.
DIR="$( cd "$( dirname "$0" )" && pwd )"
if [ -z "`amixer set Capture toggle | grep off`" ]; then
@coldic3
coldic3 / battery-notification.sh
Last active June 21, 2020 19:04
Battery Notification | Display a popup when battery is low or fully charged.
#!/bin/sh
# title: Battery Notification
# description: Display a popup when battery is low or fully charged.
# author: Kevin Kaniaburka (coldic3)
# requirements: acpi, yad
# notes: Put this script in autostart!
while true
do