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 | |
| /** | |
| * Reproduces "Warning: Undefined property: LazySnsClient::$api" followed by | |
| * "InvalidArgumentException: Operation not found: DeleteEndpoint" on PHP < 8.4. | |
| * | |
| * aws-sdk-php-symfony declares every client lazy, so Symfony wraps it in a LazyProxyTrait proxy. The first | |
| * call made from a promise callback initialises the proxy inside its magic __isset/__get. Building the real | |
| * client waits on a promise in ClientResolver, which drains Guzzle's global task queue and runs the other | |
| * queued callbacks while that __get is still on the stack. Their __get('api') on the same proxy is skipped |
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
| Doris parse number fail, string: '-----2628' — root cause analysis & fix | |
| Context | |
| Inserting CloudFront logs from a Glue/Hive JSON external table into an OLAP unique-key table: | |
| INSERT INTO internal.cloudfront.test | |
| SELECT ..., IF(`sc-content-len` = "-", NULL, `sc-content-len`) AS `sc-content-len` | |
| FROM aws_glue.`cloudfront-logs`.cloudfront WHERE ...; |
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 | |
| /** | |
| * Load a playlist's videos from the API, or return from the playlist if EXPLICIT | |
| * | |
| * @param \Drupal\brightcove\BrightcovePlaylistInterface<mixed> $entity | |
| * @return array<\Drupal\brightcove\BrightcoveVideoInterface<mixed>> | |
| */ | |
| function load_brightcove_playlist_videos(\Drupal\brightcove\BrightcovePlaylistInterface $entity): array { | |
| // Only perform API lookup for smart playlists - for others the display will render the explicitly linked videos |
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
| # Requires ZSH | |
| # Install your PHP versions via: brew install php@x.x | |
| # Where x.x is the version such as 7.4 | |
| # Do not need to link them it's harmless | |
| # Add the below to your .profile or something | |
| # Then run setphp x.x when you need to change php version - it will update php version in all terminal sessions | |
| # Add to PATH to prefer over any system installed | |
| export PATH="$HOME/bin/php:$PATH" |
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
| # yum install mysql-connector-python | |
| import ConfigParser | |
| from contextlib import contextmanager | |
| import getopt | |
| import getpass | |
| import io | |
| from mysql.connector import connection | |
| import os | |
| import re |