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
sudo -u gdm gconftool-2 --set /desktop/gnome/interface/gtk_theme --type string "Orta" | |
sudo -u gdm gconftool-2 --set /desktop/gnome/background/picture_filename --type string "/usr/share/backgrounds/Collapsar.jpg" | |
sudo -u gdm gconftool-2 --set /desktop/gnome/interface/icon_theme --type string "Faenza-Dark" |
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 | |
/** | |
* Calculate seats distribution according to the D'Hondt method. | |
* | |
* @see http://en.wikipedia.org/wiki/D'Hondt_method | |
* @author Eugene Leonovich <gen.work@gmail.com> | |
* | |
* @param array $polling An associative array (party => votes). | |
* @param integer $totalSeats The total number of seats to be allocated. |
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 | |
// Twig/AcmeExtension.php | |
namespace Acme\DemoBundle\Twig\Extension; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
class AcmeExtension extends \Twig_Extension | |
{ | |
private $container; |
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 | |
namespace Acme\Validator\Constraints; | |
use Symfony\Component\Validator\Constraint; | |
use Symfony\Component\Validator\Constraints\Valid; | |
use Symfony\Component\Validator\Exception\ConstraintDefinitionException; | |
/** | |
* @Annotation |
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 | |
for ($i = 0; $i < 1000000; ++$i) { | |
$server = $_SERVER; | |
$server += array( | |
'SERVER_NAME' => 'localhost', | |
'SERVER_PORT' => 80, | |
'HTTP_HOST' => 'localhost', | |
'HTTP_USER_AGENT' => 'Symfony/2.X', | |
'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', |
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 | |
use Buzz\Listener\ListenerInterface; | |
use Buzz\Message\MessageInterface; | |
use Buzz\Message\RequestInterface; | |
class JsonListener implements ListenerInterface | |
{ | |
/** | |
* {@inheritdoc} |
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
$ MP_BENCH_DURATION=.01 MP_BENCH_TARGETS=pure_p,pure_u,json_p,json_u php tests/bench_json.php | |
Filter: MessagePack\Tests\Perf\Filter\NameFilter | |
Rounds: 3 | |
Duration: .01 | |
============================================================================================== | |
Test/Target MessagePack\Packer MessagePack\BufferUnpacker json_encode json_decode | |
---------------------------------------------------------------------------------------------- | |
nil ......................... 39820.0000 ................ 24967.0000 . 65322.3333 . 55244.3333 | |
false ....................... 38231.0000 ................ 24824.6667 . 63387.6667 . 56517.0000 |
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 | |
use App\MessagePack\PackedMap; | |
use App\MessagePack\PackedMapTransformer; | |
use MessagePack\BufferUnpacker; | |
use MessagePack\Packer; | |
use MessagePack\PackOptions; | |
require __DIR__.'/vendor/autoload.php'; |
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 | |
// Borrowed from https://gist.github.com/denji/7c3c9d4b449f2699ec73 | |
require __DIR__.'/../vendor/autoload.php'; | |
ini_set("display_errors", 1); | |
ini_set("display_startup_errors", 1); | |
ini_set("error_reporting", E_ALL); |
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
empty_loop 0.076 | |
unpack_i16 2.097 2.021 | |
ord_i16 0.925 0.849 | |
unpack_u16 2.051 1.975 | |
ord_u16 0.740 0.664 | |
------------------------ | |
Total 5.889 | |
php -v | |
PHP 7.0.5 (cli) (built: Apr 23 2016 10:48:01) ( NTS ) |
OlderNewer