Skip to content

Instantly share code, notes, and snippets.

View mallardduck's full-sized avatar
🦑
Rockin the suburbs

Dan mallardduck

🦑
Rockin the suburbs
View GitHub Profile
@mallardduck
mallardduck / static.php
Created November 19, 2021 15:34 — forked from ezimuel/static.php
Swoole HTTP static file server example
<?php
// Simple HTTP static file server using Swoole
$host = $argv[1] ?? '127.0.0.1';
$port = $argv[2] ?? 9501;
$http = new swoole_http_server($host, $port);
// The usage of enable_static_handler seems to produce errors
// $http->set([
@mallardduck
mallardduck / checkSession.php
Last active March 27, 2020 01:33 — forked from lukas-buergi/checkSession.php
Check whether sessions work in php
<?php
error_reporting( E_ALL );
ini_set( 'display_errors', 1);
define('TEST_KEY', 'test');
define('TEST_VAL', 'test42');
$fileName = basename(__FILE__);
@mallardduck
mallardduck / functions-mu-encryption.php
Created April 24, 2019 14:21 — forked from muhammad-naderi/functions-mu-encryption.php
Wordpress encrypt usermeta data database
<?php
/**
* Created by PhpStorm.
* User: Muhammad
* Date: 05/07/2016
* Time: 01:20 PM
*/
add_filter('get_user_metadata', 'decrypt_user_meta',10,4);