#ZSH with Bash on Ubuntu on Windows
Append to the bottom of the .bashrc
# Launch Zsh
if [ -t 1 ]; then
exec zsh
fi
source $ZSH/themes/agnoster.zsh-theme | |
# Dir: current working directory | |
# %1 for one dir | |
# %2 for 2 you get it eventually | |
prompt_dir() { | |
prompt_segment blue black '%1~' | |
} | |
PROMPT='%{%f%b%k%}$(build_prompt) ' |
<?php | |
/** | |
* Example for reading zip filenames as | |
* UTF-8 strings regardless of original | |
* filename encoding | |
*/ | |
$Zip = new ZipArchive(); | |
$open = $Zip->open($filename, ZIPARCHIVE::CHECKCONS); |
<?php | |
/** | |
* Input string parser that keeps variable keys in their original state. | |
* | |
* Input string keys containing '-','.',' ' are replaced by PHP with parse_str or $_POST | |
* with '_'. So &I+have+a+space=value becomes array('I_hava_a_space'=>'value') | |
* | |
* With InputStrParser->parseCharacterSafe('I+have+a+space=value') becomes | |
* array('I hava a space'=>'value') | |
* |
<?php | |
// handy script from tycoonmaster at gmail dot com | |
// http://fi2.php.net/manual/en/function.http-build-url.php#96335 | |
// I didn't make this but I think it is useful so I store / share it here | |
if (!function_exists('http_build_url')) | |
{ | |
define('HTTP_URL_REPLACE', 1); // Replace every part of the first URL when there's one of the second URL | |
define('HTTP_URL_JOIN_PATH', 2); // Join relative paths | |
define('HTTP_URL_JOIN_QUERY', 4); // Join query strings |
<?php | |
/** | |
* Attach value $value to array path: | |
* attachValueToArrayPath('valueHere','foo[bar]') | |
* results array('foo'=>array('bar'=>'valuehere')); | |
* | |
* @param mixed $value | |
* @param string $path | |
* @return array | |
*/ |