Skip to content

Instantly share code, notes, and snippets.

View ludofleury's full-sized avatar
🐼
Yay

Ludovic Fleury ludofleury

🐼
Yay
View GitHub Profile
@ludofleury
ludofleury / sdzDoctrineGenerateMigrationsDiffTask.php
Created March 22, 2011 11:25
Custom migrations using schema.yml revision.
<?php
class sdzDoctrineGenerateMigrationsDiffTask extends sfDoctrineBaseTask
{
/**
* @see sfTask
*/
protected function configure()
{
$this->addOptions(array(
@unixmonkey
unixmonkey / Cucumber Plain Text Feature.tmLanguage
Created March 10, 2011 20:15
Cucumber Language definition file for TextMate; modified to work with Sublime Text 2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>feature</string>
</array>
<key>firstLineMatch</key>
<string>기능|機能|功能|フィーチャ|خاصية|תכונה|Функціонал|Функционалност|Функционал|Особина|Могућност|Özellik|Właściwość|Tính năng|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd(.*)</string>
@ludofleury
ludofleury / gist:828193
Created February 15, 2011 20:36 — forked from tyx/gist:816180
// Ouvre le premier lien enfant de l'élément cible
// Reproduit le comportement des navigateurs (ctrl ou cmd ou middleclick = nouvel onglet)
$('.line-click').live('click', function(e){
e.stopPropagation();
href = $(this).children('a:first').attr('href');
if (e.ctrlKey || e.metaKey || e.which == 2) {
window.open(href);
} else {
window.location = href;
}
// Ouvre le premier lien enfant de l'élément cible
// Reproduit le comportement des navigateurs (ctrl ou cmd ou middleclick = nouvel onglet)
$('.line-click').live('click', function(e){
e.stopPropagation();
href = $(this).children('a:first').attr('href');
if (e.ctrlKey || e.metaKey || e.which == 2) {
window.open(href);
} else {
window.location = href;
}
@ludofleury
ludofleury / Admin gen on multiple primary keys Model.
Created January 30, 2011 20:54
Ever dream to use admin-gen (symfony 1.4 + Doctrine 1.2) with a Model using composite primary keys ? Fast & furious tips for the routing :
app/routing.yml
In this example, my Model is identified by A string + an id.
That's why I specified requirements.
attached_file:
class: sfDoctrineRouteCollection
options:
model: AttachedFile
module: attachment
prefix_path: /attachment
@ludofleury
ludofleury / FileRelation.class.php
Created December 18, 2010 17:19
lib/model/doctrine/FileRelation.class.php Relational model between object model and file model Implement LooseCoupling doctrine behavior concept from Christian Schaefer.
<?php
/**
* FileRelation
*
*
* @package shop
* @subpackage model
* @author Christian Schaefer <[email protected]>
* @author Ludovic Fleury <[email protected]>
<?php
/*
* $Id: UnitOfWork.php 7684 2010-08-24 16:34:16Z jwage $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT