Skip to content

Instantly share code, notes, and snippets.

View wimg's full-sized avatar

Wim Godden wimg

View GitHub Profile
<?php
require 'vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
$factory = new React\Dns\Resolver\Factory();
$dns = $factory->create('8.8.8.8', $loop);
$hostnames = array(
'www.yahoo.com',
'gafdgfdgfdg',
<?php
$hostnames = array(
'www.yahoo.com',
'gafdgfdgfdg',
'fdsafdsf',
'cu.be',
'www.google.com',
'www.zendcon.com'
);
<?php
$start = microtime(true);
$urls = ['http://www.google.com/', 'http://www.yahoo.com/', 'http://cu.be', 'http://www.microsoft.com/', 'http://www.zendcon.com'];
$chandles = [];
$mh = curl_multi_init();
foreach ($urls as $key => $url) {
$chandles[$key] = curl_init();
<?php
$start = microtime(true);
$urls = ['http://www.google.com/', 'http://www.yahoo.com/', 'http://cu.be', 'http://www.microsoft.com/', 'http://www.zendcon.com'];
$chandles = [];
$mh = curl_multi_init();
foreach ($urls as $key => $url) {
$chandles[$key] = curl_init();
<?php
$start = microtime(true);
$urls = ['http://www.google.com/', 'http://www.yahoo.com/', 'http://cu.be', 'http://www.microsoft.com/', 'http://www.zendcon.com'];
foreach ($urls as $key => $url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
<?php
require_once 'vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
$socket = new React\Socket\Server($loop);
$clients = new SplObjectStorage();
$i = 0;
{
"name" : "talks",
"require" : {
"react/react" : "=v0.4.2",
"react/dns" : "=v0.4.1",
"react/event-loop" : "=v0.4.1"
},
"repositories" : [ {
"type" : "composer",
"url" : "https://packagist.org/"
@wimg
wimg / speaker.md
Last active August 29, 2015 13:56 — forked from matiaskorhonen/speaker.md
Frozen Rails submissions by Wim Godden