Skip to content

Instantly share code, notes, and snippets.

View alkemann's full-sized avatar

Alexander Morland alkemann

View GitHub Profile
@alkemann
alkemann / Git Config Alias
Last active August 23, 2019 12:01
Git configs for neat colors and aliases
[color]
ui = auto
diff = auto
status = always
branch = always
interactive = always
[color "branch"]
current = 220
local = 222
remote = 106

Keybase proof

I hereby claim:

  • I am alkemann on github.
  • I am lake (https://keybase.io/lake) on keybase.
  • I have a public key whose fingerprint is 4B50 4829 9001 5CA2 78D7 1B1F C21D FEFB 21E2 5F15

To claim this, I am signing this object:

[color]
ui = auto
diff = always
status = always
branch = always
interactive = always
[color "branch"]
current = 220
local = 222
remote = 106
@alkemann
alkemann / phone valid
Created October 31, 2011 21:21
get valid phone numbers
function _oneValidPhoneNumber($in) {
$stripped = preg_replace("/^[^0-9+]*[+]*46/", "+46", $in);
$stripped = preg_replace("/^[^0-9+]*[+]*47/", "+47", $in);
$stripped = preg_replace("/[^0-9+]/", "", $stripped);
$stripped = preg_replace("/^0046/", "+46", $stripped);
$stripped = preg_replace("/^0047/", "+47", $stripped);
if (!$stripped) return false;
if ($stripped[0] == '0') {
$stripped = substr($stripped, 1);
@alkemann
alkemann / tests.php
Created October 4, 2011 14:04
Run PHPUnit tests in browser for ease of reading, running subsets or debuggin.
<?php
/**
* Place this file in the webroot of your project,
* access it through http://project.dev/tests.php or http://localhost/project/webroot/tests.php
*
* Assuming you have defined a BASEPATH to the root of your project and
*/
define('BASEPATH', __DIR__.'/..'); // root of project, this one assumes /project/webroot/tests.php
define('LOCATION', BASEPATH .'/app'); // in a SF2 project, this is where the phpunit.xml file is