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
<?php | |
require __DIR__ . "/vendor/autoload.php"; | |
use Google\Cloud\Storage\StorageClient; | |
use GuzzleHttp\Promise; | |
# control the number of objects to upload | |
$NUM_OBJECTS = 5; | |
$storage = new StorageClient(); |
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
<?php | |
require __DIR__ . '/vendor/autoload.php'; | |
// https://github.com/googleapis/google-cloud-php/issues/5118 | |
// Warning: touch(): Google\Cloud\Storage\StreamWrapper::stream_metadata is not implemented! #5118 | |
// PR raised: https://github.com/googleapis/google-cloud-php/pull/7144 | |
use Google\Cloud\Storage\StorageClient; | |
$client = new StorageClient(['projectId' => 'XXXXXXXXXXX']); |
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
<?php | |
require __DIR__ . "/vendor/autoload.php"; | |
use Google\Cloud\Storage\StorageClient; | |
use GuzzleHttp\Promise\Each; | |
// Create a Storage client | |
$storage = new StorageClient([ | |
'projectId' => 'XXXXXXXXXX', |
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
<?php | |
// Ref: https://github.com/googleapis/google-cloud-php/issues/7088 | |
require __DIR__ . "/vendor/autoload.php"; | |
use Google\Cloud\Storage\StorageClient; | |
$gcsClient = new StorageClient([ | |
"projectId" => "XXXXXXX", | |
"requestTimeout" => 10, | |
]); | |
$gcsBucket = $gcsClient->bucket("XXXXXXX"); |
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
<?php | |
require_once __DIR__ . '/../vendor/autoload.php'; | |
## Delete all buckets (and objects inside it) with bucket name having prefix: `gcloud_testing_` | |
use Google\Cloud\Storage\StorageClient; | |
$client = new StorageClient(); | |
$buckets = $client->buckets(); |
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
<?php | |
require_once __DIR__ . '/../vendor/autoload.php'; | |
## Delete all topics and subscriptions with name having prefix: `gcloud_testing_` | |
use Google\Cloud\PubSub\PubSubClient; | |
$client = new PubSubClient(); | |
$topics = $client->topics(); |
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
<?php | |
use Google\CRC32\CRC32; | |
use GuzzleHttp\Psr7\Utils; | |
include __DIR__.'/vendor/autoload.php'; | |
$filePath = __DIR__.'/tests/System/data/5mb.txt'; | |
## USAGE: | |
# Paste the file into https://github.com/googleapis/google-cloud-php/tree/main/Storage |
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
extension=protobuf.so | |
extension=grpc.so | |
grpc.enable_fork_support=1 | |
; extension=php_openssl.so | |
; extension=xdebug.so | |
[Xdebug] | |
zend_extension=xdebug.so | |
xdebug.mode=debug |
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
# 1: Install pdfplumber from terminal : `pip3 install pdfplumber` | |
# 2: Save bank statement to a folder as `savings_bank_account_statement.pdf` | |
# 3: Password is of the format: <last 5 digit of a mobile number><dob> | |
# 4: Download `SBI-PDF-Statement-cracker.py` file and save to the same folder | |
# 5: Run this program from terminal as `python3 SBI-PDF-Statement-cracker.py` | |
import pdfplumber | |
dob = '131255' # ddmmyy format, dob value is randomized for privacy | |
for i in range (10000,100000): | |
pwd = str(i) + dob |
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
// Load a YT URL like https://www.youtube.com/watch?v=XYZABC | |
let is_not_available = ["video unavailable", "video isn't available"]. | |
some(needle => | |
document.getElementById("contents").textContent.toLowerCase().includes(needle)); |
NewerOlder