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
<?php | |
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); | |
socket_bind($sock, '0.0.0.0', 10000); | |
for (;;) { | |
socket_recvfrom($sock, $message, 1024, 0, $ip, $port); | |
$reply = str_rot13($message); | |
socket_sendto($sock, $reply, strlen($reply), 0, $ip, $port); | |
} |
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
<?php | |
/** | |
* Benchmarks BulkInserter at various batch sizes. | |
* | |
* Before running this script, make sure to: | |
* | |
* - set your PDO parameters in this file | |
* - run composer install | |
* - import setup.sql into your database |
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
password=$(grep -oP 'temporary password(.*): \K(\S+)' /var/log/mysqld.log) | |
mysqladmin --user=root --password="$password" password aaBB@@cc1122 | |
mysql --user=root --password=aaBB@@cc1122 -e "UNINSTALL PLUGIN validate_password;" | |
mysqladmin --user=root --password="aaBB@@cc1122" password "" |
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
<?php | |
/** | |
* Converts a string using CR, LF, CRLF, or possibly a mix of these, to the given EOL character(s). | |
* | |
* @param string $text The text to convert. | |
* @param string $eol The line break character(s). | |
* | |
* @return string | |
*/ |
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
<?php | |
use Brick\DateTime\LocalDate; | |
use Brick\DateTime\LocalTime; | |
use Brick\DateTime\LocalDateTime; | |
/** | |
* Formatter for date-time classes. | |
*/ | |
class DateTimeFormatter |
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
<?php | |
/** | |
* Solves the following equations: | |
* | |
* a路x + b路y = c | |
* d路x + e路y = f | |
* | |
* Returns an array with [x, y] | |
*/ |
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
<?php | |
/** | |
* Quick script to display InnoDB inserts/updates/deletes/reads per second in real time. | |
* | |
* Sample output: | |
* | |
* Inserts 40,368.63 /s | |
* Updates 19.98 /s | |
* Deletes 9.99 /s |
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
<?php | |
/** | |
* Automatically migrates Font Awesome 4 class names to Font Awesome 5 class names. | |
* | |
* WARNING: THIS WILL REWRITE YOUR FILES. | |
* BACK UP YOUR FILES BEFORE RUNNING THIS SCRIPT. | |
* YOU HAVE BEEN WARNED. | |
* | |
* Note: the migration CSV file was parsed from the official migration documentation: |
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
password=$(grep -oP 'temporary password(.*): \K(\S+)' /var/log/mysqld.log) | |
mysqladmin --user=root --password="$password" password aaBB@@cc1122 | |
mysql --user=root --password=aaBB@@cc1122 -e "UNINSTALL COMPONENT 'file://component_validate_password';" | |
mysqladmin --user=root --password="aaBB@@cc1122" password "" |
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
<?php | |
/** | |
* This script builds the .travis.yml build matrix, around these variables: | |
* | |
* - PHP versions | |
* - database drivers | |
* - platform versions | |
* | |
* With the following requirements: |