git shortlog -sne
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 | |
# add this in your repo at .git/hooks/pre-commit | |
formatter="./bin/code-formatter.sh" # your formatter script. | |
# Check if formatter exists | |
if ! command -v "$formatter" &> /dev/null; then | |
echo "Error: Formatter '$formatter' not found." | |
exit 1 |
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
test |
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 | |
ps -A --sort -rss -o comm,pmem,rss | awk ' | |
NR == 1 { print; next } | |
{ a[$1] += $2; b[$1] += $3; } | |
END { | |
for (i in a) { | |
size_in_bytes = b[i] * 1024 | |
split("B KB MB GB TB PB", unit) | |
human_readable = 0 | |
if (size_in_bytes == 0) { |
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
installDebug=false | |
function caskInstall() { | |
INSTALLSERVICE=$1 | |
if brew info --cask $INSTALLSERVICE | grep "Not installed" > /dev/null; then | |
echo "installing $INSTALLSERVICE ..." | |
brew install --cask $INSTALLSERVICE | |
brew link --overwrite $INSTALLSERVICE 2>/dev/null 1>/dev/null | |
elif [ $installDebug = true ]; then | |
brew info --cask $INSTALLSERVICE | |
fi |
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
<?php | |
$filename='database_backup_'.date('G_a_m_d_y').'.sql'; | |
$result=exec('mysqldump database_name --password=your_pass --user=root --single-transaction >/var/backups/'.$filename,$output); | |
if($output==''){ | |
echo "done"; | |
/* no output is good */ | |
} |
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
<?php | |
if (!function_exists('getallheaders')) | |
{ | |
function getallheaders() | |
{ | |
$headers = []; | |
foreach ($_SERVER as $name => $value) | |
{ | |
if (substr($name, 0, 5) == 'HTTP_') | |
{ |
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
{ | |
"Andorra": { | |
"flag": "🇦🇩", | |
"code": "AD" | |
}, | |
"United Arab Emirates": { | |
"flag": "🇦🇪", | |
"code": "AE" | |
}, | |
"Afghanistan": { |
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
<?xml version="1.0"?> | |
<ruleset name="OrderAssistent"> | |
<rule ref="Squiz.WhiteSpace.OperatorSpacing.NoSpaceBefore"></rule> | |
<rule ref="Squiz.Formatting.OperatorBracket.MissingBrackets"></rule> | |
<rule ref="Squiz.Arrays.ArrayDeclaration.NoSpaceAfterComma"></rule> | |
</ruleset> |
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
<?xml version="1.0"?> | |
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP_iPosen" xsi:noNamespaceSchemaLocation="../../../phpcs.xsd"> | |
<description>The PHP_iPosen coding standard builds on the Squiz coding standard.</description> | |
<!-- Include the whole Squiz standard except FunctionComment, which we override --> | |
<rule ref="Squiz"> | |
<exclude name="Squiz.Files.FileExtension.ClassFound"/> | |
<exclude name="Squiz.NamingConventions.ValidVariableName.NotCamelCaps"/> | |
<exclude name="Squiz.Commenting.ClosingDeclarationComment.Missing" /> | |
</rule> |
NewerOlder