This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch -r --merged origin/master | grep -vE 'master' | xargs git push origin --delete |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch --merged master | grep -vE 'master' | xargs git branch -d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
echo plural_form(42, array('арбуз', 'арбуза', 'арбузов')); | |
*/ | |
function plural_form($n, $forms) { | |
return $n%10==1&&$n%100!=11?$forms[0]:($n%10>=2&&$n%10<=4&&($n%100<10||$n%100>=20)?$forms[1]:$forms[2]); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
concat(table_schema,'.',table_name) tableName, | |
concat(round(table_rows/1000000,2),'M') rows, | |
concat(round(data_length/(1024*1024),2),'M') DATA, | |
concat(round(index_length/(1024*1024),2),'M') idx, | |
concat(round((data_length+index_length)/(1024*1024),2),'M') totalSize, | |
round(index_length/data_length,2) idxFrac | |
FROM information_schema.TABLES | |
ORDER BY data_length+index_length DESC | |
LIMIT 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Like a commit, a dropped or cleared stash is stored in a Git database until you run git gc. The lost stash is treated like a commit and you can use git fsck to find it. | |
Let's create and drop a stash with a message. | |
% echo "I'm going to stash this" >> INSTALL | |
% git add INSTALL | |
% git stash save Changes INSTALL | |
% git stash list | |
stash@{0}: On master: Changed INSTALL | |
% git stash clear |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rebase --interactive c4d25d6^ | |
# не меняем ничего кроме первого слова pick -> reword | |
reword c4d25d6 order status | |
pick 39ba64e redirect to order status after booking | |
# в следующем окне можно будет изменить комментарий | |
# если коммит был запушен | |
git push --force |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
date=$1 | |
DRY_RUN=1 | |
if [ -z $1 ]; then | |
echo "Empty date" | |
exit; | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @tables = NULL; | |
SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @tables FROM information_schema.tables | |
WHERE TABLE_SCHEMA = 'table_schema' AND TABLE_NAME <> 'table_name'; | |
SET @tables = CONCAT('DROP TABLE ', @tables); | |
PREPARE stmt1 FROM @tables; | |
EXECUTE stmt1; | |
DEALLOCATE PREPARE stmt1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[XDebug] | |
xdebug.remote_enable=true | |
xdebug.remote_connect_back=true | |
xdebug.remote_autostart=true | |
xdebug.profiler_enable=false | |
xdebug.max_nesting_level=700 | |
xdebug.idekey=PHPSTORM | |
xdebug.remote_host=docker.for.mac.localhost | |
xdebug.remote_port=9002 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XDEBUG_CONFIG="idekey=PHPSTORM" PHP_IDE_CONFIG="serverName={имя сервера}" php -d "xdebug.remote_host={IP рабочей машины}" -d "xdebug.remote_connect_back=0" -d "xdebug.remote_port=9000" -d "xdebug.remote_enable=1" $@ |
OlderNewer