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 | |
abstract class TestCase extends \Tester\TestCase | |
{ | |
private $tearDownCallbacks = []; | |
protected function addTearDownCallback($callback) | |
{ | |
if (!is_callable($callback)) { | |
throw new \InvalidArgumentException('$callback is not callable'); |
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
if (typeof HtmlFormControlsCollection == 'undefined') { | |
function HtmlFormControlsCollection( arr ) { | |
for ( var i = 0; i < arr.length; i += 1 ) { | |
this[i] = arr[i]; | |
} | |
// length is readonly | |
Object.defineProperty( this, 'length', { | |
get: function () { | |
return arr.length; |
In production mode it does nothing, in development mode it can throw these kinds of exceptions:
LogicException: You haven't passed $title to template.latte.
LogicException: $products should be an array of App\Domain\Product, string given in template.latte.
Notice: You are using undocumented variable $article in template.latte.
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
parameters: | |
doctrine: | |
entityPaths: [ %appDir%/model/Domain ] | |
proxyDir: %tempDir%/cache/_Doctrine.ORM.Proxy | |
autogenerateProxyClasses: %debugMode% | |
useSimpleAnnotationReader: TRUE | |
migrations: | |
name: Migrations | |
directory: %appDir%/migrations | |
namespace: DoctrineMigrations |
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
git clone https://github.com/joyent/node.git | |
cd node | |
git checkout v0.6.14 #Try checking nodejs.org for what the stable version is | |
./configure --prefix=~/opt/node | |
make | |
make install | |
echo prefix = ~/opt/npm >> ~/.npmrc | |
curl http://npmjs.org/install.sh | sh |
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 | |
BIND=127.0.0.1:9000 | |
USER=www-data | |
PHP_FCGI_CHILDREN=1 | |
PHP_FCGI_MAX_REQUESTS=1000 | |
PHP_CGI=/usr/bin/php-cgi | |
PHP_CGI_NAME=`basename $PHP_CGI` | |
PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND" | |
RETVAL=0 |
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/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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
user www-data; | |
worker_processes 1; | |
error_log logs/error.log; | |
pid logs/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { |
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
{if !$presenter->isAuthorized()} {* user is NOT authorized *} | |
{var urlData => [ | |
client_id => $CLIENT_ID, | |
'response_type' => code, | |
'redirect_uri' => 'http://oauth2.local' | |
. $presenter->link('Facebook:callback'), | |
'scope' => 'user_about_me,user_photos,offline_access' | |
]} | |
{* remember - in real world use state param to prevent CSRF! *} | |
<a href="https://www.facebook.com/dialog/oauth?{=http_build_query($urlData);}" title="Click to connect to Facebook"> |