Skip to content

Instantly share code, notes, and snippets.

@pgl
pgl / publishtest.php
Last active August 29, 2015 14:01
Pubnub test script
#!/usr/bin/php
<?php
/*
* CLI test script
*
* Call as:
*
* publishtest.php
* publishtest.php "uncompressed message" 0
* publishtest.php "compression test" 1 # gzip compress msg when publishing
@pgl
pgl / oneliner-split.sh
Last active August 29, 2015 14:01
Pubnub one liners
php -r 'require "./Pubnub.php";
print_r((new Pubnub("demo"))->publish(
["channel" => "my_channel", "message" => $argv[1]]
));' \
"test message"
<?php
/*
* Note: This script will directly modify the .php files in the given directory.
* It is assumed that the code is under version control, so you can easily review
* the changes using `git diff` or similar.
*/
function usageError() {
die("Usage: php -d asp_tags=1 portAlternativeTags.php dir/\n");

Keybase proof

I hereby claim:

  • I am pgl on github.
  • I am pgl (https://keybase.io/pgl) on keybase.
  • I have a public key whose fingerprint is E015 C15B 341A D1B9 A98F 4F0E 9635 6A1B 38A7 455D

To claim this, I am signing this object:

@pgl
pgl / zero-width-php-function-names.php
Created July 30, 2019 10:31
Zero-width PHP function names
<?php
function ​​‌‌‌​‌​​​‌​‌‌() {
echo "testing zero-width function names\n\n";
}
​​‌‌‌​‌​​​‌​‌‌
();

Keybase proof

I hereby claim:

  • I am pgl on github.
  • I am pgl (https://keybase.io/pgl) on keybase.
  • I have a public key whose fingerprint is 3F1D 0A0B 448F 09AB 225D B8B5 BDE2 2E17 E885 5E25

To claim this, I am signing this object: