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 | |
/** | |
* Automatically smoke test all your static routes, and all dynamic routes with default values. | |
* Adapted and simplified from https://github.com/Pierstoval/SmokeTesting | |
* On an idea from Ismail1432 https://github.com/ismail1432 on Twitter: | |
* https://twitter.com/SmaineDev/status/1559542937696043008 | |
*/ | |
namespace App\Tests\Controller; |
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
Verifying that "bzaslavskytiriel.id" is my Blockstack ID. https://onename.com/bzaslavskytiriel |
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 | |
class DeepCompare | |
{ | |
/** | |
* Deep recursive comparison tool. | |
* Function ca be used as basis for comparison and update tool. Un-static function and add updating tools (setters) | |
* | |
* @param $var1 | |
* @param $var2 |
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
'use strict'; | |
const crypto = require('crypto'); | |
const AES_METHOD = 'aes-256-cbc'; | |
const IV_LENGTH = 16; // For AES, this is always 16, checked with php | |
const password = 'lbwyBzfgzUIvXZFShJuikaWvLJhIVq36'; // Must be 256 bytes (32 characters) | |
function encrypt(text, password) { |
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
'use-strict'; | |
/** | |
* Debug toolbox startng point | |
* Usage : | |
* const utilities = require('path-to-utilities.js'); | |
* utilities.requestLogger(require('http')); | |
* utilities.unhandledRejectionMonitor(); | |
*/ | |
module.exports.requestLogger = function(httpModule){ | |
let original = httpModule.request; |
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 | |
/** | |
* @param $name | |
* @param $value | |
* @return $this | |
*/ | |
function __set($name, $value) | |
{ | |
$reflected = new \ReflectionClass($this); | |
$property = $reflected->getProperty($name); |
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
object(Symfony\Component\HttpFoundation\Request)#4 (21) { | |
["attributes"]=> | |
object(Symfony\Component\HttpFoundation\ParameterBag)#7 (1) { | |
["parameters":protected]=> | |
array(6) { | |
["id"]=> | |
string(5) "11832" | |
["provider"]=> | |
NULL |
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 | |
class Slugifier | |
{ | |
public static function slugify($string) | |
{ | |
$aArray = array('à', 'â', 'ä'); | |
$eArray = array('é', 'è', 'ê', 'ë'); | |
$iArray = array('î', 'ï'); | |
$oArray = array('ô', 'ö'); | |
$uArray = array('ù'); |
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 | |
// function defination to convert array to xml | |
function array_to_xml( $data, &$xml_data ) { | |
foreach( $data as $key => $value ) { | |
if( is_numeric($key) ){ | |
$key = 'item'.$key; //dealing with <0/>..<n/> issues | |
} | |
if( is_array($value) ) { | |
$subnode = $xml_data->addChild($key); | |
array_to_xml($value, $subnode); |
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 | |
/** | |
* Class casting | |
* | |
* @param string|object $destination | |
* @param object $sourceObject | |
* @return object | |
*/ | |
function cast($destination, $sourceObject) | |
{ |
NewerOlder