Skip to content

Instantly share code, notes, and snippets.

@pokap
pokap / webhook.php
Created November 4, 2019 16:08
Toornament webhook test php
<?php
const FILE_LOG = 'webhook.log';
ensure_log_access();
switch ($_SERVER['REQUEST_METHOD']) {
case 'HEAD':
add_log("Subscription works!");
@pokap
pokap / assertArraySimilar.php
Last active August 9, 2022 15:08
[PHPunit] assert two arrays are equal, but ignore orders
<?php
trait ArrayTestCaseTrait
{
/**
* Asserts that two associative arrays are similar.
*
* Both arrays must have the same indexes with identical values
* without respect to key ordering
*
@pokap
pokap / sites-available symfony2
Created July 15, 2015 22:15
Symfony2 nginx+hhvm config
server {
server_name localhost;
listen 8080;
root /my/relative/project/web;
access_log /var/log/nginx/my_project.access.log;
error_log /var/log/nginx/my_project.error.log;
include /etc/nginx/symfony_default.conf;
}
@pokap
pokap / gist:10687636
Last active August 29, 2015 13:59 — forked from Taluu/gist:9470625
<?php
/*
* Several strings to interpret
* With possibly several expressions in each of those
* In the service where the cloud lies within
* One string to interpret, One string to ease the perfs
* One string to bring out some stats, and in an array binds them
* In the service where the cloud lies within
*/
// some code bitch §
@pokap
pokap / SplFixedArrayTest.php
Created June 12, 2013 16:07
Notice error with push array on SplFixedArray
<?php
$a = new SplFixedArray(1);
$a[0] = array();
$a[0][] = 'test'; // notice error
// ---------------
$a = new SplFixedArray(1);