| layout | title | description | tags | ||
|---|---|---|---|---|---|
default |
SQL Style Guide |
A guide to writing clean, clear, and consistent SQL. |
|
| <?php | |
| declare(strict_Types=1); | |
| namespace Example; | |
| (function () : void { | |
| $requestFactory = new class implements ServerRequestFactory { | |
| public function __invoke() : ServerRequest | |
| { |
| :80 { | |
| root /serve | |
| } |
| # see https://github.com/cmaessen/docker-php-sendmail for more information | |
| FROM php:5-fpm | |
| RUN apt-get update && apt-get install -q -y ssmtp mailutils && rm -rf /var/lib/apt/lists/* | |
| RUN docker-php-ext-install mysql mysqli sysvsem | |
| RUN pecl install xdebug-2.5.5 \ | |
| && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ |
| <?php | |
| require_once __DIR__ . '/vendor/autoload.php'; | |
| $namespace = 'PutYourProjectNamespaceHere\\'; | |
| foreach (new RegexIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__ . '/src')), '/^.+\.php$/i', RecursiveRegexIterator::GET_MATCH) as $file) { | |
| require_once $file[0]; | |
| } |
| #!/bin/sh | |
| # OS: Ubuntu 14.01 | |
| # Generate data - produces about 200GB on disk, takes a while | |
| DATADIR=tpch-dbgen | |
| SCALE=1000 | |
| git clone https://github.com/electrum/tpch-dbgen.git | |
| cd $DATADIR && make && ./dbgen -f -v -C 16 -S 1 -s $SCALE && cd - |
| <?php | |
| class ProcessIterator implements Iterator | |
| { | |
| private $stream; | |
| private $command; | |
| private $iteration = 0; | |
| public function __construct($command) |
Moved to git repository: https://github.com/denji/nginx-tuning
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
FullCalendar was initially designed without much notion of timezones. By default, it ignores timezone offsets in the dates it receives.
The original assumption was that if you received a date from Brussels, say "2013-09-01T12:00:00+02:00", which is noon, it would display as noon in every timezone.
However, FullCalendar shoehorns this value into a local date. With the same example, if you were in San Francisco, it internally stores the date as "2013-09-01T12:00:00-08:00". This is bad for two reasons:
| <?php | |
| require_once 'PHPUnit/Autoload.php'; | |
| use \PHPUnit_Framework_TestSuite; | |
| use \PHPUnit_Framework_TestCase; | |
| use \PHPUnit_TextUI_TestRunner; | |
| class MyTestCase extends PHPUnit_Framework_TestCase { | |
| public function testSubtraction() { |