Skip to content

Instantly share code, notes, and snippets.

View onethumb's full-sized avatar
😍
Thrilling our customers.

Don MacAskill onethumb

😍
Thrilling our customers.
View GitHub Profile
@onethumb
onethumb / php-bug-53458-pdo-problem.php
Created March 19, 2013 17:40
PHP Bug #53458 reproduce script. When fetching 10K rows using prepared statements, PDO takes ~6 seconds. When fetching the same 10K rows in 1K chunks, PDO takes ~0.5 seconds. Non-prepared fetches take ~0.25 seconds. There's some sort of non-linear falloff in performance. See: https://bugs.php.net/bug.php?id=53458
<?php
/**
* For some reason, SELECT ... WHERE Id IN ( .. ) queries using prepared
* statements in PDO (either emulated or not) cause severe performance
* degradation over 1000 rows.
*
* Normal SELECT queries, including SELECT * FROM table, with hundreds of
* thousands of rows don't exhibit this problem, only WHERE IN queries.
*
*
@onethumb
onethumb / keybase.md
Created March 6, 2014 02:01
Keybase proof claim

Keybase proof

I hereby claim:

  • I am onethumb on github.
  • I am don (https://keybase.io/don) on keybase.
  • I have a public key whose fingerprint is B604 9E2D B637 CC82 514F 70A6 2ED5 219C F9FB 4656

To claim this, I am signing this object:

* << BeReq >> 3
- Begin bereq 2 fetch
- Timestamp Start: 1400090851.519220 0.000000 0.000000
- BereqMethod GET
- BereqURL /1234/Video-Tests-Dec-2013/Exploratorium-2012/i-gSNfWFW/0/SMIL/gSNfWFW.smil/media_b917414.abst/Seg1-Frag1
- BereqProtocol HTTP/1.1
- BereqHeader Host: 10.100.10.169
- BereqHeader User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36
- BereqHeader Accept: */*
- BereqHeader Referer: http://inside.smugmug.net/test/don/flowplayer.mg?ImageKey=gSNfWFW&videoService=varnish
vcl 4.0;
import directors;
probe health {
.url = "/ping/";
.expected_response = 200;
.timeout = 1s;
.interval = 1s;
}
@onethumb
onethumb / onename-passcard-verification.txt
Created May 12, 2015 14:15
Onename Passcard verification
Verifying I am +d0n on my passcard. https://onename.com/d0n
@onethumb
onethumb / mysql_splitdump.sh
Created August 15, 2016 17:34 — forked from jasny/mysql_splitdump.sh
Split MySQL dump SQL file into one file per table or extract a single table
#!/bin/bash
####
# Split MySQL dump SQL file into one file per table
# based on http://blog.tty.nl/2011/12/28/splitting-a-database-dump
####
if [ $# -lt 1 ] ; then
echo "USAGE $0 DUMP_FILE [TABLE]"
exit