We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
<?php | |
function pre_print_r($var){ | |
echo "<pre>"; | |
print_r($var); | |
echo "</pre>"; | |
} | |
function Bigrams($word){ |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Permission Cheat Sheet
chown -R www-data:www-data ./
// set the proper owner
find . -type f -exec chmod 644 {} \+
// Recursively set FILE permissions.
<?php | |
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);} |
<?php | |
/** | |
* The Signal class is the smallest and fastest observer written in PHP 5.6 and | |
* using some new features such as the variadic functions and the arguments | |
* unpacking. | |
* | |
* ...and it fits in a tweet. | |
* | |
* @author Quentin Schuler aka Sukei <[email protected]> |
<?php | |
/** | |
* The render function is a lightweight template engine, that allows string | |
* interpolation and output escaping. | |
* | |
* ...and it fits in a tweet. | |
* | |
* @author Quentin Schuler aka Sukei <[email protected]> | |
*/ |
<?php | |
/** | |
* The Container class is a lightweight service container. | |
* | |
* ...and it fits in a tweet. | |
* | |
* @author Quentin Schuler aka Sukei <[email protected]> | |
*/ | |
class Container{private $s;function set($k,$c){$this->s[$k]=$c;}function get($k){return(is_a($v=$this->s[$k],'Closure'))?$v($this):$v;}} |
<?php | |
/** | |
* The Router class is a fast and lightweight router (yes it is). It can handle | |
* a path and call the matching controller. If there is no match, then an | |
* exception will be throwned. | |
* | |
* ...and it fits in a tweet. | |
* | |
* @author Quentin Schuler aka Sukei <[email protected]> |
<?php | |
/** | |
* procedural wrappers for web request/response variables | |
* | |
* @author Jesus A. Domingo <[email protected]> | |
* @license MIT | |
*/ | |
/** | |
* Gets a request parameter (from $_GET over $_POST combination) |