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 $router \Piano\Router */ | |
$router = $app->router; | |
$router->addRoute('redirect', new \Genoa\Route\Redirect); | |
$router['homepage'] ('GET /', '\Genoa\Controller\Homepage.index'); | |
$router['tag'] ('GET /:tag-deals', '\Genoa\Controller\Tag.index'); | |
$router['outbound'] ('GET /outbound/:id', '\Genoa\Controller\Outbound.index'); | |
$router['about'] ('GET /about', '\Genoa\Controller\About.index', ['viewscript' => 'about']); |
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
/** | |
* @Given /^existing "([^"]*)" with data:$/ | |
*/ | |
public function existingWithData($arg1, TableNode $table) | |
{ | |
$collection = $arg1; | |
foreach ($table->getHash() as $row) { | |
$data = array(); | |
foreach ($row as $key => $value) { | |
if (strpos($key, "[]") !== false) { |
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
$router['homepage']('GET /', function() { | |
echo 'hi'; | |
}); |
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
'./configure' \ | |
'--prefix=/usr/local' \ | |
'--with-config-file-path=/usr/local/etc' \ | |
'--enable-mbstring' \ | |
'--with-zlib' \ | |
'--with-openssl' \ | |
'--with-curl' \ | |
'--enable-fpm' \ | |
'--with-config-file-path=/usr/local/etc' \ | |
'--enable-ftp' \ |
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
From this: | |
class FtpTransport | |
{ | |
public function __construct($host, $username, $password) | |
{ | |
} | |
} | |
Allow me to generate this: |
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 Deduplicator | |
{ | |
protected $items = []; | |
public function add($item) | |
{ | |
// name field will be in $item->name | |
$this->items[] = $item; | |
} |
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 | |
passthru('clear'); | |
$args = array(1,2,3,4,5); | |
class Foo | |
{ | |
public function bar($args) | |
{ | |
$args[] = 6; | |
echo '$args inside Foo->bar(): ' . "\n" . print_r($args, 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
'./configure' '--prefix=/usr/local' '--with-config-file-path=/usr/local/etc' '--with-mysql=/usr/local/mysql' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-pdo-mysql=/usr/local/mysql/bin/mysql_config' '--enable-mbstring' '--with-zlib' '--with-openssl' '--with-curl' '--with-xsl' '--enable-fpm' '--enable-soap' |
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 | |
chdir("/home/offers/www/offers-qa/coral"); | |
`git checkout next`; | |
`git reset --hard HEAD`; | |
`git pull`; | |
chdir("/home/offers/www/offers-qa/orca"); | |
`git checkout next`; | |
`git reset --hard HEAD`; | |
`git pull`; | |
$date = `git log --max-count=1 | grep Date`; |
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
import sublime, sublime_plugin | |
from subprocess import Popen, PIPE, STDOUT | |
class RunPhpCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
content = self.view.substr(sublime.Region(0, self.view.size())) | |
php = Popen(['/usr/local/bin/php'], stdout=PIPE, stdin=PIPE) | |
php.stdin.write(content) | |
output = php.communicate()[0] | |
newtab = self.view.window().new_file() |