Skip to content

Instantly share code, notes, and snippets.

View gabiudrescu's full-sized avatar

Gabi Udrescu gabiudrescu

View GitHub Profile
<?php
$sites = "http://www.broadcastsolutions.com.au/
http://www.kvm.com.au/
http://www.ambertech.com.au/";
$sites = preg_split('/\r\n|\r|\n/', $sites);
echo "
@jamesmoey
jamesmoey / ExtendedArrayCollection.php
Last active July 24, 2023 07:02
Extend array collection from Doctrine with operation to perform on all the item in the collection.
<?php
namespace Collections;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\PropertyAccess\PropertyAccess;
class ExtendedArrayCollection extends ArrayCollection
{
/**
@ngfw
ngfw / gist:4684951
Created January 31, 2013 18:15
PHP Base62 Class
<?php
/**
* Base62: A class to convert a number from any base between 2-62 to any other base between 2-62
* It doesn't use BC Math functions so works without the use of BC Math library.
* It uses the native base_convert functions when the base is below 36 for faster execution.
* The output number is backward compatible with the native base_convert function.
*
* Author : Lalit Patel
* Website: http://www.lalit.org/lab/base62-php-convert-number-to-base-62-for-short-urls
* License: Apache License 2.0
@Koc
Koc / gist:3016704
Created June 29, 2012 08:42
Doctrine2 DISTANCE function
<?php
namespace Myako\Geographical\Functions;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
/**
* "DISTANCE" "(" LatitudeFrom, LongitudetFrom, LatitudeTo, LongitudeTo ")"
*