Skip to content

Instantly share code, notes, and snippets.

View jmwebservices's full-sized avatar
🏠
Working from home

Jerry Martinez jmwebservices

🏠
Working from home
View GitHub Profile
@jmwebservices
jmwebservices / bench.php
Created August 24, 2018 09:56 — forked from nikic/bench.php
Benchmark of call_user_func_array vs switch optimization vs argument unpacking syntax
<?php error_reporting(E_ALL);
function test() {}
$nIter = 1000000;
$argNums = [0, 1, 2, 3, 4, 5, 100];
$func = 'test';
foreach ($argNums as $argNum) {
@jmwebservices
jmwebservices / rrmdir.php
Last active November 3, 2022 20:49 — forked from liconti/rrmdir.php
PHP recursive rmdir
<?php
/**
* Recursively empty and delete a directory
*
* @param string $path
* @ref https://gist.github.com/jmwebservices/986d9b975eb4deafcb5e2415665f8877
*/
function rrmdir( string $path ) : void
{
@jmwebservices
jmwebservices / convert-pgp-to-ssh.sh
Created January 19, 2023 00:02 — forked from mdellavo/convert-pgp-to-ssh.sh
Convert PGP Public Key to OpenSSH
# import the public key
gpg --import ../alice.asc
gpg --export $KEYID | openpgp2ssh $KEYID