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
-- Display size of all databases in a MySQL server | |
SELECT table_schema AS 'Database Name', | |
sum(data_length + index_length) AS 'Size in Bytes', | |
round((sum(data_length + index_length) / 1024 / 1024), 4) AS 'Size in MB' | |
FROM information_schema.TABLES | |
WHERE table_schema NOT IN ('information_schema', | |
'performance_schema', | |
'mysql', | |
'sys') | |
GROUP BY table_schema |
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
To recursively give directories read&execute privileges: | |
find /path/to/base/dir -type d -exec chmod 755 {} + | |
To recursively give files read privileges: | |
find /path/to/base/dir -type f -exec chmod 644 {} + |
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
function convert_number_to_words($number) { | |
$hyphen = '-'; | |
$conjunction = ' '; | |
$separator = ' '; | |
$negative = 'eksi '; | |
$big_currency = ' türk lirası '; | |
$sma_currency = ' kuruş'; | |
$dictionary = array( |
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
$array = array( | |
array('key' => 'key', 'value' => 1), | |
array('key' => 'bey', 'value' => 1), | |
array('key' => 'zey', 'value' => 1), | |
array('key' => 'aey', 'value' => 1) | |
); | |
uasort($array, | |
function($a, $b) | |
{ |
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
function replaceAt(string, index, replace) { | |
return string.substring(0, index) + replace + string.substring(index + 1); | |
} |