This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// initialize the JadedPHP library here | |
class MyController extends Jaded_Controller | |
{ | |
protected function process(Jaded_Request $oRequest, Jaded_Response $oResponse) | |
{ | |
$oResponse->assign('myVar', 'this is the assigned value'); | |
$oResponse->assign('requestVar', $oRequest->getParam('reqParam')); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
# look for URLS like 'subdir.username.foo.bar' | |
RewriteCond %{ENV:REDIRECT_STATUS} ^$ | |
RewriteCond %{HTTP_HOST} ([^.]+)\.([^.]+)\.foo\.bar$ | |
RewriteCond /home/%2/public_html/%1 -d | |
RewriteRule ^(.+) %{HTTP_HOST}$1 [C] | |
RewriteRule ([^.]+)\.([^.]+)\.foo\.bar(?::\d+)?(.*) /home/$2/public_html/$1$3 [L] | |
# look for URLS liks 'username.foo.bar' | |
RewriteCond %{ENV:REDIRECT_STATUS} ^$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assuming an instance tagged with Foo=bar | |
# Using the aws-tools | |
ec2-describe-tags --filter key=Foo value=bar | cut -f3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
use Everyman\Neo4j\Transport, | |
Everyman\Neo4j\Client, | |
Everyman\Neo4j\Batch, | |
Everyman\Neo4j\Relationship, | |
Everyman\Neo4j\Node; | |
error_reporting(-1); | |
ini_set('display_errors', 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
namespace Everyman\Neo4j; | |
use Everyman\Neo4j\Transport, | |
Everyman\Neo4j\Client, | |
Everyman\Neo4j\Batch, | |
Everyman\Neo4j\Relationship, | |
Everyman\Neo4j\Node; | |
error_reporting(-1); | |
ini_set('display_errors', 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "\nCopy-on-write:\n"; | |
$a = array(array("result" => "a")); | |
for ($i=0; $i < 2; $i++) { | |
foreach ($a as $j => $v) { | |
$v["result"] .= "a"; | |
echo $v["result"] ."\n"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CareLink Linux | |
// version 0.0 | |
// | |
//-------------------------------------------------- | |
// | |
// This script allows users of Chrome on Linux to | |
// access the Minimed CareLink site at | |
// http://carelink.minimed.com | |
// | |
//-------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
use Everyman\Neo4j\Transport, | |
Everyman\Neo4j\Client, | |
Everyman\Neo4j\Index, | |
Everyman\Neo4j\Relationship, | |
Everyman\Neo4j\Node; | |
error_reporting(-1); | |
ini_set('display_errors', 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias json-decode="php -r 'print_r(json_decode(file_get_contents(\"php://stdin\")));'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface Command | |
{ | |
public static function register(); | |
public function execute(); | |
} | |
class HelloCommand implements Command { | |
protected $name; |
OlderNewer