Skip to content

Instantly share code, notes, and snippets.

<?php
$opts = getopt ('', array(
'access-key:',
'secret-key:',
'bucket:',
'prefix:',
'marker:'
));
<?php
function mb_fgets($fh)
{
$buf = '';
$pos = false;
$fstart = ftell($fh);
while( !feof($fh) ) {
$str = fread($fh, 256);
if( $str === false ) {
break;
#!/usr/bin/env python3
import sys
from PIL import Image
xterm256colors = [ # http://pln.jonas.me/xterm-colors
(0, (0x00, 0x00, 0x00)), # SYSTEM
(1, (0x80, 0x00, 0x00)), # SYSTEM
(2, (0x00, 0x80, 0x00)), # SYSTEM
(3, (0x80, 0x80, 0x00)), # SYSTEM
(4, (0x00, 0x00, 0x80)), # SYSTEM
@jbboehr
jbboehr / composer
Created April 3, 2015 06:04
Composer xdebug unloader
#!/bin/sh
COMPOSER_BIN=`which composer.phar`
PHP_BIN=`which php`
PHP_EXTENSION_DIR=`php -r 'echo ini_get("extension_dir");'`
EXTENSIONS=`find $PHP_EXTENSION_DIR -name "*.so" | egrep -v '(xdebug|opcache)'`
PHP_ARGS=' -n -d allow_url_fopen=On -d detect_unicode=Off '
for x in $EXTENSIONS; do
PHP_ARGS="$PHP_ARGS -d extension=$x "
done
COMMAND="$PHP_BIN $PHP_ARGS $COMPOSER_BIN"
@jbboehr
jbboehr / php53-info
Created April 19, 2015 01:34
TravisCI PHP 5.3 phpinfo
phpinfo()
PHP Version => 5.3.29
System => Linux testing-worker-linux-c55820f2-1-17200-linux-15-59080796 2.6.32-042stab094.7 #1 SMP Wed Oct 22 12:43:21 MSK 2014 x86_64
Build Date => Feb 11 2015 14:34:24
Configure Command => './configure' '--with-config-file-path=/home/travis/.phpenv/versions/5.3.29/etc' '--with-config-file-scan-dir=/home/travis/.phpenv/versions/5.3.29/etc/conf.d' '--prefix=/home/travis/.phpenv/versions/5.3.29' '--libexecdir=/home/travis/.phpenv/versions/5.3.29/libexec' '--enable-intl' '--with-openssl' '--without-pear' '--with-gd' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-freetype-dir=/usr' '--with-freetype' '--enable-exif' '--enable-zip' '--with-zlib' '--with-zlib-dir=/usr' '--with-mcrypt=/usr' '--with-pdo-sqlite' '--enable-soap' '--enable-xmlreader' '--with-xsl' '--enable-ftp' '--with-tidy' '--with-xmlrpc' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-shmop' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable-pcntl' '--with-re
@jbboehr
jbboehr / php54-info
Created April 19, 2015 01:35
TravisCI PHP 5.4 phpinfo
phpinfo()
PHP Version => 5.4.37
System => Linux testing-worker-linux-027f0490-1-22342-linux-16-59080797 2.6.32-042stab090.5 #1 SMP Sat Jun 21 00:15:09 MSK 2014 x86_64
Build Date => Feb 11 2015 14:48:31
Configure Command => './configure' '--with-config-file-path=/home/travis/.phpenv/versions/5.4.37/etc' '--with-config-file-scan-dir=/home/travis/.phpenv/versions/5.4.37/etc/conf.d' '--prefix=/home/travis/.phpenv/versions/5.4.37' '--libexecdir=/home/travis/.phpenv/versions/5.4.37/libexec' '--enable-intl' '--with-openssl' '--without-pear' '--with-gd' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-freetype-dir=/usr' '--with-freetype' '--enable-exif' '--enable-zip' '--with-zlib' '--with-zlib-dir=/usr' '--with-mcrypt=/usr' '--with-pdo-sqlite' '--enable-soap' '--enable-xmlreader' '--with-xsl' '--enable-ftp' '--with-tidy' '--with-xmlrpc' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-shmop' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable-pcntl' '--with-re
@jbboehr
jbboehr / php55-info
Created April 19, 2015 01:35
TravisCI PHP 5.5 phpinfo
phpinfo()
PHP Version => 5.5.21
System => Linux testing-worker-linux-380b67c9-2-9674-linux-9-59080798 2.6.32-042stab094.7 #1 SMP Wed Oct 22 12:43:21 MSK 2014 x86_64
Build Date => Feb 11 2015 15:20:09
Configure Command => './configure' '--with-config-file-path=/home/travis/.phpenv/versions/5.5.21/etc' '--with-config-file-scan-dir=/home/travis/.phpenv/versions/5.5.21/etc/conf.d' '--prefix=/home/travis/.phpenv/versions/5.5.21' '--libexecdir=/home/travis/.phpenv/versions/5.5.21/libexec' '--enable-intl' '--with-openssl' '--without-pear' '--with-gd' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-freetype-dir=/usr' '--with-freetype' '--enable-exif' '--enable-zip' '--with-zlib' '--with-zlib-dir=/usr' '--with-mcrypt=/usr' '--with-pdo-sqlite' '--enable-soap' '--enable-xmlreader' '--with-xsl' '--enable-ftp' '--with-tidy' '--with-xmlrpc' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-shmop' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable-pcntl' '--with-read
@jbboehr
jbboehr / php56-info
Created April 19, 2015 01:36
TravisCI PHP 5.6 phpinfo
phpinfo()
PHP Version => 5.6.5
System => Linux testing-worker-linux-e7a62211-1-3044-linux-17-59080799 2.6.32-042stab090.5 #1 SMP Sat Jun 21 00:15:09 MSK 2014 x86_64
Build Date => Feb 11 2015 15:36:44
Configure Command => './configure' '--with-config-file-path=/home/travis/.phpenv/versions/5.6.5/etc' '--with-config-file-scan-dir=/home/travis/.phpenv/versions/5.6.5/etc/conf.d' '--prefix=/home/travis/.phpenv/versions/5.6.5' '--libexecdir=/home/travis/.phpenv/versions/5.6.5/libexec' '--enable-intl' '--with-openssl' '--without-pear' '--with-gd' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-freetype-dir=/usr' '--with-freetype' '--enable-exif' '--enable-zip' '--with-zlib' '--with-zlib-dir=/usr' '--with-mcrypt=/usr' '--with-pdo-sqlite' '--enable-soap' '--enable-xmlreader' '--with-xsl' '--enable-ftp' '--with-tidy' '--with-xmlrpc' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-shmop' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable-pcntl' '--with-readline
@jbboehr
jbboehr / php7-info
Created April 19, 2015 01:37
TravisCI PHP 7 phpinfo
phpinfo()
PHP Version => 7.0.0-dev
System => Linux testing-worker-linux-bb3654bb-2-11898-linux-20-59080800 2.6.32-042stab090.5 #1 SMP Sat Jun 21 00:15:09 MSK 2014 x86_64
Build Date => Apr 16 2015 23:54:53
Configure Command => './configure' '--with-config-file-path=/home/travis/.phpenv/versions/nightly/etc' '--with-config-file-scan-dir=/home/travis/.phpenv/versions/nightly/etc/conf.d' '--prefix=/home/travis/.phpenv/versions/nightly' '--libexecdir=/home/travis/.phpenv/versions/nightly/libexec' '--enable-intl' '--with-openssl' '--with-pear' '--with-gd' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-freetype-dir=/usr' '--with-freetype' '--enable-exif' '--enable-zip' '--with-zlib' '--with-zlib-dir=/usr' '--with-mcrypt=/usr' '--with-pdo-sqlite' '--enable-soap' '--enable-xmlreader' '--with-xsl' '--enable-ftp' '--with-tidy' '--with-xmlrpc' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-shmop' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable-pcntl' '--wit
Xdebug is loaded, trying to re-run with bare configuration
+------------------------------+------+-------------+--------------+----------+
| Test | Runs | Total (s) | Average (ms) | Ops/msec |
+------------------------------+------+-------------+--------------+----------+
| arguments (compiler) | 500 | 0.00705504 | 0.0141101 | 70.8713 |
| array-each (compiler) | 500 | 0.0314162 | 0.0628324 | 15.9154 |
| array-mustache (compiler) | 500 | 0.033345 | 0.06669 | 14.9948 |
| complex (compiler) | 500 | 0.068074 | 0.136148 | 7.34495 |
| data (compiler) | 500 | 0.0380549 | 0.0761099 | 13.1389 |
| depth-1 (compiler) | 500 | 0.0312698 | 0.0625396 | 15.9899 |