Skip to content

Instantly share code, notes, and snippets.

@iamdey
iamdey / Book.php
Created April 12, 2012 13:57
Mise en application du Patron Visiteur avec Doctrine2
<?php
namespace Entity;
/**
* Le livre est l'élément visité.
* De cette manière on peut lui apliquer des traitements sans affecter sa structure tout en gardant la séparation Modèle/Controlleur
*/
class Book implements \Reader\Element
{
@iamdey
iamdey / text.php
Created April 30, 2012 16:02
sceditor in a popin
<?php
var_dump($_POST);
$content = (isset($_POST['content'])) ? $_POST['content'] : '';
?>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="vendors/SCEditor/jquery.sceditor.js"></script>
<script src="vendors/SCEditor/jquery.sceditor.bbcode.js"></script>
<link rel="stylesheet" href="vendors/SCEditor/minified/jquery.sceditor.min.css" type="text/css" media="all" />
@iamdey
iamdey / lamp-install-dev.sh
Last active April 30, 2017 14:12
Ubuntu Lamp Install script for symfony2 development
#!/bin/bash
sudo apt-get install apache2 php5 mysql-server libapache2-mod-php5 php5-mysql php5-sqlite php5-intl php5-cli php-apc php5-xdebug acl git
## configuration apache
sudo sed -i 's#/var/www#/vagrant#g' /etc/apache2/sites-available/default
sudo adduser www-data vagrant
## config php apache DEV
@iamdey
iamdey / .bash_aliases
Last active October 4, 2015 22:37
my git aliases
alias ga='git add'
alias gb='git branch'
alias gc='git commit'
alias gp='git pull'
alias gs='git status'
alias gl='git log --decorate --graph --oneline'
alias gck='git checkout'
@iamdey
iamdey / gist:3951441
Created October 25, 2012 08:34
get last git commit hash
#!/bin/bash
git log --format=%H -n1
@iamdey
iamdey / robot.js
Created December 7, 2012 12:44
vanilla
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@iamdey
iamdey / robot.js
Created December 7, 2012 23:08 — forked from Isinlor/robot.js
disabled (isinBot)
/*
* It would be great if you fork & upgrade
* created by; Zolmeister
* edited by: Isinlor
* - added clone
* - upgrade of aim - for cloned robot
* - upgrade of aim - counting missed attack and adaptation
* - upgrade of dodge - move according to the hp
* edited by: type your nickname
* - what you changed - description
@iamdey
iamdey / post-install.sh
Last active May 14, 2021 04:18
Post install script for my debian based desktop
#!/bin/bash
# gnome shell
# http://askubuntu.com/questions/73030/can-i-get-unity-style-super1-9-keyboard-shortcuts-for-launching-apps-in-gnome
sudo apt-get install gnome-shell wmctrl xbindkeys
cat """
#Terminal
"wmctrl -xa Terminal || terminal"
@iamdey
iamdey / A.php
Created March 26, 2013 10:28
Proxy class creation
<?php
namespace Reflected;
use A as Base;
/**
* Proxy class exemple
*
* @author depely
@iamdey
iamdey / DoctrineChoiceType.php
Created March 28, 2013 14:05
Symfony2 form widget mixed between entity & choice
<?php
namespace Acme\DemoBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Doctrine\Bundle\DoctrineBundle\Registry;
use Symfony\Component\OptionsResolver\Options;
use Doctrine\Common\Util\Inflector;
use Symfony\Component\Form\Exception\FormException;