Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
// It is important to declare your variables. | |
(function() { | |
var foo = 'Hello, world!'; | |
print(foo); //=> Hello, world! | |
})(); | |
// Because if you don't, the become global variables. | |
(function() { |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
#!/usr/bin/env php | |
<?php | |
$app = function($request) { | |
$body = <<<EOS | |
<!DOCTYPE html> | |
<html> | |
<meta charset=utf-8> | |
<title>Hello World!</title> |
<?php | |
// !!! Warning: for reference, not debugged | |
################################################################### | |
# PHP_Fourier 0.03b | |
# Original Fortran source by Numerical Recipies | |
# PHP port by Mathew Binkley (binkleym@nukote.com) | |
################################################################### |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
<?php die('This file is not really here!'); | |
/** | |
* ------------- DO NOT UPLOAD THIS FILE TO LIVE SERVER --------------------- | |
* | |
* Implements code completion for CodeIgniter in phpStorm | |
* phpStorm indexes all class constructs, so if this file is in the project it will be loaded. | |
* ------------------------------------------------------------------- | |
* Drop the following file into a CI project in phpStorm | |
* You can put it in the project root and phpStorm will load it. |
This gist assumes:
<?php | |
$countries = | |
array( | |
"AF" => "Afghanistan", | |
"AL" => "Albania", | |
"DZ" => "Algeria", | |
"AS" => "American Samoa", | |
"AD" => "Andorra", | |
"AO" => "Angola", |
<?php | |
trait MetaClass | |
{ | |
protected $__classMethods = array(); | |
static protected $__staticMethods = array(); | |
public function __call($name, $args) | |
{ |
var toast=function(msg){ | |
$("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h3>"+msg+"</h3></div>") | |
.css({ display: "block", | |
opacity: 0.90, | |
position: "fixed", | |
padding: "7px", | |
"text-align": "center", | |
width: "270px", | |
left: ($(window).width() - 284)/2, | |
top: $(window).height()/2 }) |