Nicolas Grekas - nicolas.grekas, gmail.com
17 June 2011 - Last updated on 3 sept. 2011
Not updated any more on this gist. See:
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
Cycle array of URLs and process with phantom.js (http://www.phantomjs.org/) | |
Adds Array.prototype.forEachWebPage() iterator. | |
EXAMPLE: | |
Save screenshots. Command line: | |
phantomjs phantom_js_url_cycle.js ./screenshots | |
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
[ |
Nicolas Grekas - nicolas.grekas, gmail.com
17 June 2011 - Last updated on 3 sept. 2011
Not updated any more on this gist. See:
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
<?php | |
function is_valid_luhn($number) { | |
settype($number, 'string'); | |
$sumTable = array( | |
array(0,1,2,3,4,5,6,7,8,9), | |
array(0,2,4,6,8,1,3,5,7,9)); | |
$sum = 0; | |
$flip = 0; | |
for ($i = strlen($number) - 1; $i >= 0; $i--) { | |
$sum += $sumTable[$flip++ & 0x1][$number[$i]]; |
/* | |
* L.TileLayer is used for standard xyz-numbered tile layers. | |
*/ | |
L.Google = L.Class.extend({ | |
includes: L.Mixin.Events, | |
options: { | |
minZoom: 0, | |
maxZoom: 18, | |
tileSize: 256, |
<?php | |
$calibration = benchmark(function() { }); | |
$benchmark = benchmark(function() { | |
sleep(1); | |
}); | |
echo "Calibration run: ".number_format($calibration)."/sec\n"; | |
echo "Benchmark run: ".number_format($benchmark)."/sec\n"; | |
echo 'Approximate code execution time (seconds): '.number_format((1/$benchmark) - (1/$calibration), 10); |
This playbook has been removed as it is now very outdated. |
# This is a basic VCL configuration file for varnish. See the vcl(7) | |
# man page for details on VCL syntax and semantics. | |
# | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "8000"; | |
# health check: every 5 secs, sliding window of 5 checks of which 3 must be good | |
.probe = { | |
.url = "/"; | |
.interval = 5s; |
#!/usr/bin/php | |
<?php | |
/** | |
* .git/hooks/pre-commit | |
* | |
* This pre-commit hooks will check for PHP error (lint), and make sure the code | |
* is PSR compliant. | |
* | |
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer) | |
* |