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 | |
RewriteRule ^(\w{5})$ /index.php?key=$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
#!/bin/bash | |
HOOK_NAMES="applypatch-msg pre-applypatch post-applypatch pre-commit prepare-commit-msg commit-msg post-commit pre-rebase post-checkout post-merge pre-receive update post-receive post-update pre-auto-gc" | |
HOOK_DIR=$(git rev-parse --show-toplevel)/.git/hooks | |
DIR=$(dirname "$0") | |
for hook in $HOOK_NAMES; do | |
# If the hook already exists, is executable, and is not a symlink | |
if [ ! -h "$HOOK_DIR/$hook" -a -x "$HOOK_DIR/$hook" ]; then | |
mv "$HOOK_DIR/$hook" "$HOOK_DIR/$hook.local" | |
fi |
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
#!/bin/bash | |
# phpbrew-php will determine the PHP version of the project from the NetBeans project or composer.json. | |
command_exists () { | |
type "$1" &> /dev/null ; | |
} | |
vergte() { | |
[ "$1" = "`echo -e "$1\n$2" | sort -V | tail -n1`" ] |
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
0xfEBDC084cA75b7d053D22b93644d9D9A012f7859 |
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 | |
class FooController extends Controller | |
{ | |
/** | |
* @var FooGateway | |
*/ | |
protected $foos; | |
/** |
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 | |
$secretword = "secret"; # Change this before use | |
$matches = null; | |
if (!empty($_REQUEST['AUTH']) && preg_match('/^(\w++):(\d++):(\w++)$/', $_REQUEST['AUTH'], $matches)) { | |
$username = str_rot13($matches[1]); | |
$time = (int)$matches[2]; | |
$authhash = $matches[3]; | |
$logged_in = md5($username . $time . $secretword) === $authhash && $time >= time() - 3000; | |
} |
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 | |
$file = $argv[1]; | |
$tagToStruct = function($value, $tag) { | |
$key = substr($tag, 1); | |
return ["<$key>" => $value]; | |
}; | |
$callbacks = [ |
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 | |
var_dump("1" == 1); | |
var_dump("1" != 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 | |
/** | |
* Render and send e-mail | |
*/ | |
class Email extends PHPMailer | |
{ | |
/** | |
* @var Twig_Environment | |
*/ |