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
| private static function isBase64Encoded(string $text): bool | |
| { | |
| if (false === $decoded = base64_decode($text, true)) { | |
| return false; | |
| } | |
| // check if decoded text consists only of unicode letters, digits and white space | |
| if (!preg_match('|^[\p{L}\d\s]+$|u', $decoded)) { | |
| return false; | |
| } |
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
| docker run --rm --interactive --tty --volume $PWD:/app --user $(id -u):$(id -g) composer create-project symfony/skeleton my-api | |
| cd my-api | |
| docker run --rm --interactive --tty --volume $PWD:/app --user $(id -u):$(id -g) composer require --dev phpunit |
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
| $em | |
| ->getConnection() | |
| ->getWrappedConnection() | |
| ->setAttribute(\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false); |
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
| $shifted = ($value >> $n) | ($value << (30 - $n) & 0x3fffffff); |
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
| sort --random-sort customer.csv | split --lines 29175 |
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 COUNT(*) | |
| FROM customer | |
| WHERE is_active = 1 | |
| AND ( | |
| register_phone LIKE '50%' | |
| OR register_phone LIKE '51%' | |
| OR register_phone LIKE '53%' | |
| OR register_phone LIKE '57%' | |
| OR register_phone LIKE '60%' | |
| OR register_phone LIKE '66%' |
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 | |
| DATE_FORMAT(FROM_UNIXTIME(p.updated_at), '%Y-%m-%d') AS updated_at | |
| FROM product p |
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
| iconv -f utf8 -t cp1250 file.txt | sed 's/$'"/`echo \\\r`/" >file_cp1250_crlf.txt |