Skip to content

Instantly share code, notes, and snippets.

<?php
abstract class TestCase extends \Tester\TestCase
{
private $tearDownCallbacks = [];
protected function addTearDownCallback($callback)
{
if (!is_callable($callback)) {
throw new \InvalidArgumentException('$callback is not callable');
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.
parameters:
doctrine:
entityPaths: [ %appDir%/model/Domain ]
proxyDir: %tempDir%/cache/_Doctrine.ORM.Proxy
autogenerateProxyClasses: %debugMode%
useSimpleAnnotationReader: TRUE
migrations:
name: Migrations
directory: %appDir%/migrations
namespace: DoctrineMigrations
@mkoubik
mkoubik / install-node-and-npm.sh
Created April 9, 2012 14:12
Install node.js and npm under a user
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
#!/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
#!/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
user www-data;
worker_processes 1;
error_log logs/error.log;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
{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">