This file contains 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/bash | |
protected_branch='master' | |
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | |
if [ $protected_branch = $current_branch ] | |
then | |
echo -en "\033[31mYou're about to push master, is that what you intended? [y|n] \033[0m" | |
echo -en "\033[1m" | |
read -n 1 -r < /dev/tty |
This file contains 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/bash | |
# Warn before pushing to protected branches | |
# Make script executable with chmod +x pre-push | |
# Bypass with git push --no-verify | |
BRANCH=`git rev-parse --abbrev-ref HEAD` | |
PROTECTED_BRANCHES="^(master|main)" | |
if [[ "$BRANCH" =~ $PROTECTED_BRANCHES ]]; then | |
read -p "Are you sure you want to push to \"$BRANCH\" ? (y/n): " -n 1 -r < /dev/tty |
This file contains 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
xcode-select --install | |
# You should install brew https://brew.sh/index_fr | |
brew install automake autoconf curl pcre bison re2c mhash libtool icu4c gettext jpeg openssl libxml2 mcrypt gd gmp libevent zlib libzip bzip2 imagemagick pkg-config oniguruma | |
brew link --force icu4c | |
brew link --force openssl | |
brew link --force libxml2 | |
curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew | |
chmod +x phpbrew |
This file contains 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
security add-generic-password -a login -s service -w password |
This file contains 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
cat input.json | jq -c '.results[] | {name, party, cash: .cash_on_hand} | select(.cash | tonumber > 1000000)' |
This file contains 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| egrep -v "(^\*|master|dev|stage)" | xargs git branch -d |
This file contains 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
CREATE TABLE `slow_log` ( | |
`start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP | |
ON UPDATE CURRENT_TIMESTAMP, | |
`user_host` mediumtext NOT NULL, | |
`query_time` time NOT NULL, | |
`lock_time` time NOT NULL, | |
`rows_sent` int(11) NOT NULL, | |
`rows_examined` int(11) NOT NULL, | |
`db` varchar(512) NOT NULL, | |
`last_insert_id` int(11) NOT NULL, |
This file contains 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 foreign_key_checks = 0; | |
drop table men; | |
drop table hobbies; | |
drop table man_hobbies; | |
set foreign_key_checks = 1; | |
create table if not exists men | |
( | |
id bigint unsigned auto_increment not null, | |
name varchar(255) not null, |
This file contains 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
regexp==== RUN .* | |
colour=blue | |
- | |
regexp=--- PASS: .* | |
colour=green | |
- | |
regexp=^PASS$ | |
colour=green | |
- | |
regexp=^(ok|\?) .* |
This file contains 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 | |
table_schema as `Database`, | |
table_name AS `Table`, | |
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` | |
FROM information_schema.TABLES | |
ORDER BY (data_length + index_length) DESC; |
NewerOlder