Skip to content

Instantly share code, notes, and snippets.

View jmikola's full-sized avatar
💭
🌭

Jeremy Mikola jmikola

💭
🌭
View GitHub Profile
@jmikola
jmikola / transcript.txt
Created May 15, 2014 18:56
Laracon ReactPHP chat server
217.249: 10.10.218.139: 10.10.217.247: 10.10.217.232: 10.10.218.16: 10.10.219.203: 10.10.217.101: 10.10.217.212: 10.10.217.249: 10.10.217.249: 10.10.217.162: 10.10.218.74: 10.10.218.170: 10.10.218.178: 10.10.219.196: 10.10.218.249: 10.10.218.60: 10.10.218.70: 10.10.218.154: 10.10.217.197: 10.10.218.81: 10.10.218.5: 10.10.218.128: 10.10.217.173: 10.10.218.149: 10.10.219.147: 10.10.217.249: 10.10.217.186: 10.10.217.232: 10.10.218.168: 10.10.218.174: 10.10.218.191: 10.10.217.212: 10.10.218.16: 10.10.218.139: 10.10.219.203: 10.10.218.193: 10.10.217.101: 10.10.217.247: 10.10.217.173: 10.10.218.168: 10.10.218.74: 10.10.218.5: 10.10.218.249: 10.10.218.170: 10.10.218.149: 10.10.219.196: 10.10.218.178: 10.10.218.70: 10.10.217.197: 10.10.218.60: 10.10.218.154: 10.10.218.128: 10.10.218.81: 10.10.219.147: 10.10.218.191: 10.10.218.174: 10.10.218.139: 10.10.218.193: 10.10.217.249: 10.10.217.186: 10.10.217.162: 10.10.217.212: 10.10.217.101: 10.10.218.16: 10.10.217.232: 10.10.217.247: 10.10.218.5: :q
10.10.219.203: 10.10.
@jmikola
jmikola / transcript.txt
Created May 22, 2014 16:58
php[tek] ReactPHP chat server
$ telnet 192.168.13.14 2014
Trying 192.168.13.14...
Connected to 192.168.13.14.
Escape character is '^]'.
hello
192.168.12.221: ohai
192.168.13.89: GET / HTTP/1.1
Host: 192.168.13.14:2014
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
<?php
namespace Doctrine\ODM\MongoDB\Tests;
use Doctrine\Common\EventSubscriber;
use Doctrine\ODM\MongoDB\Events;
use Doctrine\ODM\MongoDB\Event\PreUpdateEventArgs;
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
class SO23927996Test extends BaseTest
<?php
namespace Doctrine\ODM\MongoDB\Tests;
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
class GH895Test extends \Doctrine\ODM\MongoDB\Tests\BaseTest
{
public function testQueryWithSelectShouldRefreshDocument()
{
@jmikola
jmikola / keybase.md
Created September 18, 2014 03:22
keybase.io verification

Keybase proof

I hereby claim:

  • I am jmikola on github.
  • I am jmikola (https://keybase.io/jmikola) on keybase.
  • I have a public key whose fingerprint is 9BDD 799A F089 CA7C 85F4 C2D9 31AC A407 0A84 538D

To claim this, I am signing this object:

@jmikola
jmikola / ExponentialBackoff.php
Created September 24, 2014 20:58
Exponential backoff callback for https://github.com/igorw/retry
<?php
class ExponentialBackoff
{
private $invoked = 0;
private $slotTimeUsec;
public function __construct($slotTimeUsec)
{
$this->slotTimeUsec = (int) $slotTimeUsec;
@jmikola
jmikola / transcript.txt
Created October 10, 2014 16:31
Symfony Live NYC ReactPHP chat server
$ telnet jmikola.net 8888
Trying 97.107.131.54...
Connected to jmikola.net.
Escape character is '^]'.
hello
131.107.200.34: hi
131.107.200.34: hello
69.164.215.64: YOLO
131.107.200.34: hello
131.107.200.34: Hello Jeremy
@jmikola
jmikola / montepi.php
Created October 15, 2014 18:00
Monte Carlo Pi Estimation
<?php
$iterations = isset($argv[1]) ? (int) $argv[1] : 100000000;
$randmax = mt_getrandmax();
$hits = 0;
for ($i = 0; $i < $iterations; ++$i) {
$x = mt_rand() / $randmax;
$y = mt_rand() / $randmax;
if (sqrt($x * $x + $y * $y) <= 1.0) {
@jmikola
jmikola / venues.json
Created October 27, 2014 15:40
ZendCon 2014 - Silex MongoDB Application
{ "_id" : { "$oid" : "40958b80f964a520e8f21ee3" }, "name" : "Faultline Brewing Company", "contact" : { "phone" : "4087362739", "formattedPhone" : "(408) 736-2739", "twitter" : "faultlinebrew" }, "location" : { "address" : "1235 Oakmead Parkway", "crossStreet" : "at Lakeside Dr", "lat" : 37.38760471295436, "lng" : -121.9925254583359, "postalCode" : "94085-4040", "cc" : "US", "city" : "Sunnyvale", "state" : "CA", "country" : "United States", "formattedAddress" : [ "1235 Oakmead Parkway (at Lakeside Dr)", "Sunnyvale, CA 94085-4040" ] }, "categories" : [ { "id" : "50327c8591d4c4b30a586d5d", "name" : "Brewery", "pluralName" : "Breweries", "shortName" : "Brewery", "icon" : { "prefix" : "https://ss3.4sqi.net/img/categories_v2/food/brewery_", "suffix" : ".png" }, "primary" : true } ], "verified" : false, "stats" : { "checkinsCount" : { "$numberLong" : "7085" }, "usersCount" : { "$numberLong" : "3925" }, "tipCount" : { "$numberLong" : "66" } }, "url" : "http://www.orderatfaultlinebrewing.com", "hasMenu" : true, "reser
@jmikola
jmikola / transcript.txt
Created October 30, 2014 16:49
ZendCon ReactPHP chat server
$ telnet jmikola.net 8888
Trying 97.107.131.54...
Connected to jmikola.net.
Escape character is '^]'.
hello
?
anyone
buell66.78.236.243: _ .------------. _
er66.78.236.243: (_( )_)
66.78.236.243: HELLO