Skip to content

Instantly share code, notes, and snippets.

View Firehed's full-sized avatar
🐰

Eric Stern Firehed

🐰
View GitHub Profile
@Firehed
Firehed / benchmark.php
Created May 23, 2012 20:44
Dead-simple benchmarking tool
<?php
function benchmark($i, $function) {
if (!is_callable($function)) {
return false;
}
$st = microtime(1);
while ($i--) {
$function();
}
return microtime(1) - $st;
@Firehed
Firehed / Bcrypt.php
Created February 13, 2012 00:30
Simple PHP 5.3+ Bcrypt class and functions
<?php
/*
By Marco Arment <[email protected]>.
This code is released in the public domain.
THERE IS ABSOLUTELY NO WARRANTY.
Usage example:
// In a registration or password-change form: