Skip to content

Instantly share code, notes, and snippets.

View lyrixx's full-sized avatar
😀

Grégoire Pineau lyrixx

😀
View GitHub Profile
@lyrixx
lyrixx / git2svn_tag.sh
Created September 25, 2012 14:28
Git 2 svn : create tag
#!/bin/bash
# set -x
for t in `git tag` ; do git tag -d $t > /dev/null ; done
for branch in `git -c "color.ui"=false branch -r`; do
if echo "$branch" | \grep -v "^tag" 2>&1 >/dev/null ; then
continue
fi
@lyrixx
lyrixx / deploy.php
Created September 25, 2012 16:20
depoy via zip
<?php
/* Define your constante here */
define('DESTINATION_BASE', '/home/sensio/dev/danone_prod/');
define('DESTINATION_FOLDER_BASENAME', 'DANONEPRO_PHP_%s');
define('DESTINATION_FOLDER_DOC_BASENAME', 'DANONEPRO_PHP_DOC_%s');
/* Do not touch after */
@lyrixx
lyrixx / fab-doc.py
Created November 12, 2012 21:44
fab-doc
from fabric.api import local, abort, lcd, settings
from fabric.colors import red, green
from fabric.decorators import task
import os
@task
def post_commit(sha1=None, push=False):
"""
Call this task after a commit.
Sample of post-commit hook:
@lyrixx
lyrixx / getGlobalVarInWindow.js
Created December 14, 2012 19:59
get all global vars stored in window
(function(k,l,r,m,i,e,c,o,g){
for(i in window) k.push(i)
e = document.createElement("iframe")
e.style.display = "none"
document.body.appendChild(e)
c = e.contentWindow
for(o in c) l.push(o)
for(g=k.length;m < g;m++) if(!~l.indexOf(k[m])) r.push(k[m])
return r
})([],[],[],0)
@lyrixx
lyrixx / code.php
Created December 27, 2012 10:56
Form debug
<?php
Forms::createFormFactory()->createBuilder();
// see https://github.com/sensiolabs/connect/blob/master/tests/SensioLabs/Connect/Bridge/Symfony/Form/ErrorTranslatorTest.php#L18
// With form on master (commit 0277f1a9c3bec27083c8aa79837c26b6f81b1ae8)
@lyrixx
lyrixx / .gitignore
Last active December 15, 2015 08:18
Rapt crawler.
/composer.lock
/vendor/
@lyrixx
lyrixx / .gitignore
Last active December 17, 2015 07:09
Symfony debug exception listenner
/vendor/
@lyrixx
lyrixx / css.php
Last active December 17, 2015 14:59
Assets async
<?php
sleep(10);
header('Content-Type: text/css');
echo 'h1 { color: red; }';
@lyrixx
lyrixx / goto-sample.php
Created June 19, 2013 21:41
goto-sample.php
public function foo()
{
$bool = true;
a:
try {
$bool = $this->do()
} catch($e)
goto a;
}
<?php
function waitContinue($message, $timeout, closure $timeoutCallback) {
$read = array(STDIN);
$write = null;
$except = null;
$answer = '';
fwrite(STDOUT, trim($message) . ': ');