Skip to content

Instantly share code, notes, and snippets.

Avatar

Michal Vrchota techi602

View GitHub Profile
@techi602
techi602 / convert.php
Last active Sep 22, 2015
PHP short array
View convert.php
<?php
/**
* PHP 5.4 Short Array Syntax Converter
*
* Command-line script to convert PHP's "array()" syntax to PHP 5.4's
* short array syntax "[]" using PHP's built-in tokenizer.
*
* This script is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@techi602
techi602 / find-unused-translations.php
Last active Aug 29, 2015
Find unused translations for Shopio
View find-unused-translations.php
<?php
/**
* for cygwin:
* set CYGWIN=nodosfilewarning
*/
if (PHP_SAPI != 'cli') {
exit;
}
@techi602
techi602 / gist:6156660
Last active Dec 20, 2015
PHP match IPv4 address range
View gist:6156660
<?php
/**
* Matches
* XXX.XXX.XXX.XXX
* XXX.XXX.XXX.XXX-ZZZ
* XXX.XXX.XXX.XXX-XXX.XXX.XXX.ZZZ
*
*
* @param string $range
* @param string $ip