Skip to content

Instantly share code, notes, and snippets.

View makhnanov's full-sized avatar
🎯
Focusing

Roman makhnanov

🎯
Focusing
View GitHub Profile
@makhnanov
makhnanov / fix-git-mode.sh
Last active March 1, 2024 13:41
How to change permission for not changed files in git
echo "Enter your slave branch:"
read your_branch
echo "Enter your main branch:"
read master_branch
changes=$(git --no-pager diff --name-only "$master_branch" "$your_branch")
while IFS= read -r file;
do
file_changes=$(git --no-pager diff "$master_branch" "$your_branch" -- "$file")
line_count=$(echo "$file_changes" | wc -l)
if [ "$line_count" -eq 3 ]; then
@makhnanov
makhnanov / gist:648d5d7ab54347f69241d2566eee374b
Last active March 1, 2024 12:55
Bluetooth Headphones Pause = Next Track Workaround Yandex Music Script
// ==UserScript==
// @name Pause = Next Track Workaround Yandex Music Script
// @namespace http://tampermonkey.net/
// @version 2024-03-01
// @description try to take over the world!
// @author You
// @match https://music.yandex.ru/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=yandex.ru
// @grant none
// ==/UserScript==
@makhnanov
makhnanov / gist:862d7de6b337cbe1458f1c09c732dd6c
Created October 9, 2023 14:34
Easy debug on prod with rsync
while true; do rsync -r --ignore-times --rsh="/usr/bin/sshpass -p SecretPassword ssh -o StrictHostKeyChecking=no -l root" ./ root@8.8.your.ip:/var/www/path/on/remote/serv/; inotifywait -r ./; done
@makhnanov
makhnanov / watch.sh
Created August 7, 2023 11:45 — forked from JarredMack/watch.sh
Bash file watcher
#!/bin/sh
############
# Usage
# Pass a path to watch, a file filter, and a command to run when those files are updated
#
# Example:
# watch.sh "node_modules/everest-*/src/templates" "*.handlebars" "ynpm compile-templates"
############
@makhnanov
makhnanov / gist:1d9652f082a23a71544fd559e1a309da
Created August 3, 2023 10:57
Yii2 yii\console\widgets\Table to markdown style to output.
$table->setListPrefix('');
$table->setChars([
Table::CHAR_TOP => '',
Table::CHAR_TOP_MID => '',
Table::CHAR_TOP_LEFT => '',
Table::CHAR_TOP_RIGHT => '',
Table::CHAR_BOTTOM => '',
Table::CHAR_BOTTOM_MID => '',
Table::CHAR_BOTTOM_LEFT => '',
Table::CHAR_BOTTOM_RIGHT => '',