I hereby claim:
- I am ljungmark on github.
- I am ljungmark (https://keybase.io/ljungmark) on keybase.
- I have a public key ASDUf2JnEUvsMXMhULkB5OOM-iUXnPUEpdtCD70nd8st9Qo
To claim this, I am signing this object:
<?php | |
function partial_match($needle, $haystack) { | |
if(!is_array($haystack)) return false; | |
foreach ($haystack as $key=>$item) { | |
if (strpos($item, $needle) !== false) return true; | |
} | |
return false; | |
} |
<?php | |
function ip4_to_hex($ip_address = null) { | |
if ($ip_address === null || filter_var($ip_address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false) return 'Unable to read IP address'; | |
$fragments = explode('.', $ip_address); | |
return sprintf('%02x%02x%02x%02x', $fragments[0], $fragments[1], $fragments[2], $fragments[3]); | |
} | |
print ip4_to_hex($_SERVER['REMOTE_ADDR']); |
<?php | |
function readable_filesize($file = null, $decimals = 2) { | |
if ($file === null) return 'Unable to read file'; | |
$sizes = array('B','kB','MB','GB','TB','PB','EB','ZB','YB'); | |
$factor = floor((strlen($file) - 1) / 3); | |
return sprintf("%.{$decimals}f", $file / pow(1024, $factor)) . @$sizes[$factor]; | |
} | |
print readable_filesize(filesize('example.zip')); |
function mandatory() { | |
throw new Error('Missing parameter'); | |
} | |
function foo(mustBeProvided = mandatory()) { | |
return mustBeProvided; | |
} |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Basic HTML5 Template</title> | |
<link rel="stylesheet" href="css/styles.css"> | |
<!--[if lt IE 9]> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script> | |
<![endif]--> | |
</head> |
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |
I hereby claim:
To claim this, I am signing this object:
.selector { | |
font-size: calc(14px + (100vw / 50)); | |
} | |
@media screen and (min-width: 1200px) { | |
.selector { | |
font-size: calc(14px + (1200px / 50)); | |
} | |
} |
sudo chown -R $(whoami):admin /usr/local |
curl https://phar.phpunit.de/phpunit.phar -L -o phpunit.phar | |
chmod +x phpunit.phar | |
mv phpunit.phar /usr/local/bin/phpunit |