Skip to content

Instantly share code, notes, and snippets.

View techi602's full-sized avatar

Michal Vrchota techi602

View GitHub Profile
@techi602
techi602 / gist:6156660
Last active December 20, 2015 15:49
PHP match IPv4 address range
<?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
@techi602
techi602 / find-unused-translations.php
Last active August 29, 2015 14:12
Find unused translations for Shopio
<?php
/**
* for cygwin:
* set CYGWIN=nodosfilewarning
*/
if (PHP_SAPI != 'cli') {
exit;
}
@techi602
techi602 / convert.php
Last active September 22, 2015 11:03
PHP short array
<?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