I hereby claim:
- I am iksi on github.
- I am iksi (https://keybase.io/iksi) on keybase.
- I have a public key ASBD9jM2bNQypuCqFuG4tw_rR6MMQoOYtw4cQ5WhS-PfNAo
To claim this, I am signing this object:
# Set CLICOLOR if you want Ansi Colors in iTerm2 | |
export CLICOLOR=1 | |
# Set colors to match iTerm2 Terminal Colors | |
export TERM=xterm-256color |
I hereby claim:
To claim this, I am signing this object:
<?php | |
function copyDirectory($sourceDirectory, $destinationDirectory) { | |
// determine the files that need to be copied | |
$files = new RecursiveIteratorIterator( | |
new RecursiveDirectoryIterator($sourceDirectory, FilesystemIterator::SKIP_DOTS) | |
); | |
foreach ($files as $file) { | |
$sourcePath = $file->getPathname(); | |
$destinationPath = $destinationDirectory . DS . $sourcePath; |
// put this inside a function to check the time it takes to complete | |
var start = performance.now() | |
// do stuff | |
var duration = performance.now() - start | |
console.log(duration) |
<?php | |
if (file_exists($_SERVER['DOCUMENT_ROOT'] . $_SERVER['REQUEST_URI'])) return false; | |
$_SERVER['SCRIPT_NAME'] = DIRECTORY_SEPARATOR . 'index.php'; | |
require_once $_SERVER['DOCUMENT_ROOT'] . $_SERVER['SCRIPT_NAME']; |
<?php | |
// removes querystrings | |
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); | |
if (file_exists($_SERVER['DOCUMENT_ROOT'] . $path)) return false; | |
// what the .htaccess would normally do | |
if (preg_match('/^\/panel\/(.*)/', $path)) { | |
$_SERVER['SCRIPT_NAME'] = DIRECTORY_SEPARATOR . 'panel' . DIRECTORY_SEPARATOR . 'index.php'; |
<?php | |
// removes querystrings | |
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); | |
if (file_exists($_SERVER['DOCUMENT_ROOT'] . $path)) return false; | |
// what the .htaccess would normally do | |
if (preg_match('/^\/panel\/(.*)/', $path)) { | |
$_SERVER['SCRIPT_NAME'] = DIRECTORY_SEPARATOR . 'panel' . DIRECTORY_SEPARATOR . 'index.php'; |
<?php | |
// negate possible problematic locale decimal_point for inline styles | |
$paddingTop = (float) number_format(4 / 3 * 100, 2, '.', ''); | |
echo "padding-top:{$paddingTop}%;"; |
<style> | |
.embed { | |
position: relative; | |
} | |
.embed__ratio { | |
display: block | |
} | |
.embed__content { |
<?php | |
// http://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl/ | |
// convert hex to hsl | |
$hex = str_split(ltrim('#0099cc', '#'), 2); | |
// convert the rgb values to the range 0-1 | |
$rgb = array_map(function($part) { | |
return hexdec($part) / 255; |