Skip to content

Instantly share code, notes, and snippets.

View hhamon's full-sized avatar

Hugo Hamon hhamon

View GitHub Profile
ssh-dss AAAAB3NzaC1kc3MAAACBAOqnzIFC/WAfYOg0LK/urnowNLq65PkwGVmxt01t4G6UvCGef38O2gB9xVXEwkbg9pExIS/2p7vecNja2fdEyU7DCQfu6vpzILBFeZI/9Epq6QkbT5exvsJgjazaYRCMlWs5fYMpwLdvWy9Nb9ggHCFmGm4Q+tD6oAcIScjUeh1JAAAAFQDWFXVjAyhixyjBb2MnOR3iIMAEAwAAAIBGtyYIOAr6XFkzTa99+2Y/6GqDkEFsfqlXAEGXI5CSsSxiYND0+9fT0VTiljXpGyvkO0qRtkEm1ueS5IJbYxzOq+lyAZMDaBsXr00wfmvXHPGoZrjnXKJTs4Vi+lDZv/gyG+Sz5S7sK0xYCWeYGg6/dDO1ihciUSKsqcVEaZR5QwAAAIEA5u4utgy2FyR6ljb05nYYg9E9XJ4KQXN8jYnyRlrR0Hd2oqwDzdspq2etWe/0GKTqLwrr3t8CDPbZV8vlVTTzJELQwFx8PnpRabji4xXWS+511c0eQrmjqHxNbx3rRz3CRO0bpVV2UIj0uLHtXu8NNmL2x3k48E/ky5t1TofnYAE= Hugo@hugo.dev.clever-age.net
<?php
namespace Sensio\Bundle\JobeetBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
/**
* The Affiliate entity class.
*
* @orm:Entity
<?php
#
# Even if the $bar property is private, it can be accessed publicly and modified by the modify() method
# that modifies an instance of the same PHP class.
#
class Foo
{
private $bar;
<?xml version="1.0" encoding="UTF-8"?>
<database name="default" namespace="Sensio\Bundle\BlogBundle\Model" defaultIdMethod="native">
<table name="sl_blog_post" phpName="Post">
<column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true" />
<column name="title" type="varchar" size="100" />
<column name="body" type="longvarchar" size="20" />
<column name="is_published" type="boolean" defaultValue="true" />
<column name="created_at" type="timestamp" defaultValue="now"/>
</table>
<?php
------ Symfony2 API ---------------
interface UserInterface
{
// ...
public function equals(UserInterface $user);
}
Building fixtures in tests/Fixtures/bookstore OK
Building fixtures in tests/Fixtures/bookstore-packaged Execution of target "insert-sql" failed for the following reason: /Users/hugo.hamon/Development/Propel2/tools/generator/build-propel.xml:191:1: You haven't provided an sqldbmap, or the one you specified doesn't exist: /Users/hugo.hamon/Development/Propel2/tests/Fixtures/bookstore-packaged/build/sql/sqldb.map
[phing] /Users/hugo.hamon/Development/Propel2/tools/generator/build-propel.xml:191:1: You haven't provided an sqldbmap, or the one you specified doesn't exist: /Users/hugo.hamon/Development/Propel2/tests/Fixtures/bookstore-packaged/build/sql/sqldb.map
OK
Building fixtures in tests/Fixtures/namespaced OK
Building fixtures in tests/Fixtures/reverse/mysql [phing] SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'book'
OK
Building fixtures in tests/Fixtures/schemas [phing] SQLSTATE[42000]: Syntax error or access
@hhamon
hhamon / gist:1974593
Created March 4, 2012 20:07
Optional arguments in JS
Reversi.prototype.getNewCell = function (row, col) {
var cell = { 'row': 0, 'col': 0 };
if (undefined !== row) {
cell.row = parseInt(row);
}
if (undefined !== col) {
cell.col = parseInt(col);
@hhamon
hhamon / Module.php
Created April 27, 2012 15:52
Listenning to the bootstrap MVC event
<?php
namespace NewModule;
use Zend\EventManager\StaticEventManager;
use Zend\EventManager\EventDescription as Event;
use Zend\EventManager\StaticEventManager;
class Module
{
phpunit --bootstrap tests/bootstrap.php --coverage-html ./coverage tests/Propel/Tests/Generator/Model/
PHP Deprecated: /Users/hugo.hamon/Development/Propel2/vendor/.composer/autoload.php is deprecated, please use vendor/autoload.php or vendor/composer/autoload_* instead
See https://groups.google.com/forum/#!msg/composer-dev/fWIs3KocwoA/nU3aLko9LhQJ for details in /Users/hugo.hamon/Development/Propel2/vendor/.composer/autoload.php on line 3
PHP Stack trace:
PHP 1. {main}() /opt/local/bin/phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() /opt/local/bin/phpunit:46
PHP 3. PHPUnit_TextUI_Command->run() /opt/local/lib/php/PHPUnit/TextUI/Command.php:130
PHP 4. PHPUnit_TextUI_Command->handleArguments() /opt/local/lib/php/PHPUnit/TextUI/Command.php:139
PHP 5. PHPUnit_TextUI_Command->handleBootstrap() /opt/local/lib/php/PHPUnit/TextUI/Command.php:562
@hhamon
hhamon / gist:2900910
Created June 9, 2012 13:04
Weaver Life as a Git History
cd weaver/
git add single.php
git commit -m'Ryan is a single man'
git add leanna.php
git commit -m"Added Leanna to Ryan's life"
git mv single.php engaged.php
git commit -m'Ryan & Leanna are engaged'
git mv engaged.php married.php
git commit -m'Congratz!'
git push