Skip to content

Instantly share code, notes, and snippets.

View jubianchi's full-sized avatar
🏳️‍🌈
nyan nyan nyan

Julien BIANCHI jubianchi

🏳️‍🌈
nyan nyan nyan
View GitHub Profile
## Lancez cette commande dans un tertminal
cat <<EOT | sudo tee /usr/local/bin/which_sf && sudo chmod +x /usr/local/bin/which_sf
#!/bin/sh
./symfony | perl -ne 'if( /^([a-zA-Z0-9\-]+)/ ) { \$first = \$1; } elsif ( /^\s*(:[a-zA-Z0-9\-]+)/ ) { print \$first . \$1 . "\n"; }' | grep \$1
EOT
##
##Usage :
which_sf foo
@jubianchi
jubianchi / gist:1550214
Created January 2, 2012 10:33
Debugger vos script PHP-Cli avec XDebug à la demande
## Lancez cette commande dans un tertminal
echo -e '#!/bin/sh\nphp -dxdebug.remote_autostart=On $*' | sudo tee /usr/local/bin/xdebug && sudo chmod +x /usr/local/bin/xdebug
##Usage :
#Debugger un script PHP
xdebug mon_script.php
#Debugger une task Symfony
xdebug ./symfony ns:command
@jubianchi
jubianchi / .gitconfig
Created October 31, 2011 16:43
My Git Aliases
[alias]
graph = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
summary = log --summary --name-only --abbrev-commit --color --color-words --date=relative
#If you are using Tig as your core.pager
[alias]
graph = log --graph --pretty=format:'%h -%d %s (%cr) <%an>' --abbrev-commit --no-color --date=relative
summary = log --summary --name-only --abbrev-commit --no-color --date=relative
@jubianchi
jubianchi / gist:1297545
Created October 19, 2011 05:44
Get the computed CSS styles of an element
(function(){
var sel = prompt('Selector...'),
elt = $(sel),
gcs = ('getComputedStyle' in window ? getComputedStyle : document.defaultView.getComputedStyle),
cs = gcs(elt.get(0), null),
css = [],
scss = ''
space = '&nbsp;&nbsp;&nbsp;&nbsp;';
if(window.console) console.group(sel);
@jubianchi
jubianchi / sf2_standalone_form.php
Created August 25, 2011 07:31
How to use Symfony2 Form Component Standalone
<?php
namespace Standalone\Form;
use \Symfony\Component\HttpFoundation as SHttp;
use \Symfony\Component\Form as SForm;
use \Symfony\Component\DependencyInjection as SDI;
use \Symfony\Bridge as SBridge;
//Register all your autoload function here
//...