Skip to content

Instantly share code, notes, and snippets.

View ialert's full-sized avatar

ialert

  • Ukraine
View GitHub Profile
@ialert
ialert / backup.sh
Created October 30, 2016 12:31
Сreate 7z archive for all directories in current folder
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
command="ls -l | grep "^d""
for i in $(ls -d */);
do
dir=$PWD/${i%%/}
cd "$dir" && 7z a -mx5 "../${i%%/}.7z"
cd ..
@ialert
ialert / protocol.reg
Created November 5, 2016 19:27
Adds new URL Protocol in windows registry(e. g. soapcast application)
REGEDIT4
[HKEY_CLASSES_ROOT\sop]
@="URL:sop Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\sop\shell]
[HKEY_CLASSES_ROOT\sop\shell\open]
@ialert
ialert / pre-commit
Created October 25, 2018 20:55 — forked from fesor/pre-commit
php-cs-fixer pre-commit hook
#!/usr/bin/env bash
echo "php-cs-fixer pre commit hook start"
PHP_CS_FIXER="bin/php-cs-fixer"
PHP_CS_CONFIG=".php_cs"
CHANGED_FILES=$(git diff --cached --name-only --diff-filter=ACM -- '*.php')
if [ -n "$CHANGED_FILES" ]; then
$PHP_CS_FIXER fix --config "$PHP_CS_CONFIG" $CHANGED_FILES;
git add $CHANGED_FILES;