Skip to content

Instantly share code, notes, and snippets.

View jmikola's full-sized avatar
💭
🌭

Jeremy Mikola jmikola

💭
🌭
View GitHub Profile
@jmikola
jmikola / bench.log
Created May 25, 2015 14:57
Benchmarking PHP exception throws and backtrace generation
$ php bench.php
Throwing: 0.060640
Assigning and throwing: 0.064791
Assigning once and throwing: 0.011064
@jmikola
jmikola / transcript.txt
Last active August 29, 2015 14:19
Lone Star PHP ReactPHP chat server
Script started on Sat 18 Apr 2015 01:41:51 PM CDT
$ telnet jmikola.net 8888
Trying 97.107.131.54...
Connected to jmikola.net.
Escape character is '^]'.
Hello.
24.173.35.158: Hi!
24.173.35.158: GET / HTTP/1.1
Host: jmikola.net:8888
Connection: keep-alive
@jmikola
jmikola / PedantryTest.php
Created March 18, 2015 21:47
Pedantic tests that have nothing to do with functional correctness
<?php
namespace MongoDB\Tests;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use ReflectionClass;
use ReflectionMethod;
use RegexIterator;
@jmikola
jmikola / irc.log
Created February 20, 2015 16:32
Who is jortSort?
[11:25] <jmikola> can you explain http://jort.technology/ to me?
[11:25] <jmikola> i read the page very carefully but i still couldn't figure out what it does
[11:25] <jmikola> again, barely in the tech field at this point
[11:26] <jmikola> i assume it makes the user sort things via some prompts?
[11:26] <jmikola> in which case it's super slow
[11:27] <dcousineau> jmikola: there is nothing to understand
[11:27] <jmikola> oh wait
[11:27] <jmikola> i just ran it in the mongo shell
[11:27] <jmikola> wtf
[11:27] <jmikola> this is pointless
@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
@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 / 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 / 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 / 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 / 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: