Skip to content

Instantly share code, notes, and snippets.

View docteurklein's full-sized avatar

Florian Klein docteurklein

View GitHub Profile
<?php
class SomeScreenSpec
{
function it_should_definitly_allow_to_add_something_via_a_form()
{
$this->mink->doSomeStuff()->and()->assertSomeStuff();
}
}
### Keybase proof
I hereby claim:
* I am docteurklein on github.
* I am docteurklein (https://keybase.io/docteurklein) on keybase.
* I have a public key whose fingerprint is 3D72 A8B7 E58D 01F7 72CD 17D7 962C 67BE E5C3 F3FC
To claim this, I am signing this object:
HTTP/1.1 404 Not Found
Content-Length: 5
Nope
@docteurklein
docteurklein / Bundle.php
Created October 2, 2014 11:33
bundle is its own compiler pass
<?php
class App extends Bundle implements CompilerPassInterface
{
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass($this);
}
public function process(ContainerBuilder $container)
{
SELECT
a.*,
COUNT(c.comment_id) OVER (PARTITION BY c.article_id, _r.associated_article_id) nb_comments,
COUNT(_r.weight) OVER (PARTITION BY _r.associated_article_id, _r.article_id) nb_associated_articles,
c.*,
r.*,
_r.weight
FROM article a
LEFT JOIN comment c USING (article_id)
LEFT JOIN relates_to _r ON a.article_id = _r.article_id
api:
build: fig/php
ports:
- '8000:8000'
working_dir: /src
volumes:
- backend:/src
entrypoint: [php, '-dextension=gearman.so', '-ddate.timezone=UTC']
command: '-S 0.0.0.0:8000 -t web'
links:
@docteurklein
docteurklein / controller.php
Created July 29, 2015 08:59
how to make the selected offer checked?
$data = [
'offer' => new OfferForCustomer($ticket->getCustomer(), $ticket->getOffer(), 0, 0, 0),
];
$form = $this->createForm('season_ticket', $data, [
propel.targetPackage = lib.model
propel.packageObjectModel = true
propel.project = sfShop
propel.database = mysql
propel.database.driver = mysql
propel.database.url = mysql:dbname=###;host=localhost
propel.database.user = ###
propel.database.password = ###
propel.database.encoding = utf8
HOW TO :
- Déclarer les composants dans modules.yml
- Créer une page (form) et y ajouter le widget Form.
- Créer une sous-page ( edition) de celle citée juste au dessus et y ajouter le widget Edit.
- aller a l'URL : /form/edition?id=1
git submodule update --recursive \
&& git submodule foreach git checkout master \
&& git submodule foreach git fetch \