Skip to content

Instantly share code, notes, and snippets.

View efenacigiray's full-sized avatar

Efe Naci Giray efenacigiray

  • DeliveryHero
  • Berlin
View GitHub Profile
@efenacigiray
efenacigiray / db_size.sql
Last active November 28, 2019 13:21
Database Size Estimation Queries
-- 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
@efenacigiray
efenacigiray / gist:e96a78944abb50bc3ad2
Last active June 10, 2020 13:16
To recursively give directories only or files only read & execute privileges:
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 {} +
@efenacigiray
efenacigiray / gist:d87c960201ed17ecd717
Created June 25, 2015 11:11
Rakam > Yazı Çevirici Türk Lirası
function convert_number_to_words($number) {
$hyphen = '-';
$conjunction = ' ';
$separator = ' ';
$negative = 'eksi ';
$big_currency = ' türk lirası ';
$sma_currency = ' kuruş';
$dictionary = array(
$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)
{
@efenacigiray
efenacigiray / replaceAt
Last active August 23, 2023 17:55
Javascript replace char at index
function replaceAt(string, index, replace) {
return string.substring(0, index) + replace + string.substring(index + 1);
}