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
@pborreli
pborreli / YourCommand.php
Last active August 23, 2020 09:48
Show progress of a file download inside Symfony 2.3 console #howto
<?php
protected function execute(InputInterface $input, OutputInterface $output)
{
$progress = $this->getHelperSet()->get('progress');
$ctx = stream_context_create(array(), array('notification' => function ($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max) use ($output, $progress) {
switch ($notification_code) {
case STREAM_NOTIFY_FILE_SIZE_IS:
$progress->start($output, $bytes_max);
break;
@mageekguy
mageekguy / .treemap.php
Created March 26, 2013 13:01
Configruation file to generate atoum treemap
<?php
use
mageekguy\atoum\scripts\treemap,
mageekguy\atoum\scripts\treemap\analyzers,
mageekguy\atoum\scripts\treemap\categorizer
;
class commit implements treemap\analyzer
{
@mageekguy
mageekguy / gist:5222226
Created March 22, 2013 15:35
Using scripts\treemap.php
To known how to use it, just do `php scripts/treemap.php --help`.
By default, there is no analyzer defined, so to add them, create a configuration file and add in it:`
```
<?php
use mageekguy\atoum\scripts\treemap\analyzers;
$script
->addAnalyzer(new analyzers\token())
->addAnalyzer(new analyzers\size())
@jubianchi
jubianchi / .gitconfig
Last active December 14, 2015 15:29
git stashstash
[alias]
stashstash = "!f() { STASH=$(git stash); echo \"\\033[0;31mKouroukoukou roukoukou stash stash\\033[0m\"; echo \"$STASH\"; xdg-open \"http://www.youtube.com/watch?v=LpE1bJp8-4w&feature=youtu.be&t=47s\" > /dev/null 2>&1 & }; f"
satsh = !git stashstash
@jakzal
jakzal / atoum.php
Last active December 14, 2015 14:29
<?php
namespace vendor\project\tests\units;
require_once 'path/to/mageekguy.atoum.phar';
include 'path/to/project/classes/helloWorld.php';
use \mageekguy\atoum;
use \vendor\project;
@leoallen85
leoallen85 / Preferences.sublime-settings
Created March 1, 2013 10:12
Recommended Sublime User settings, you can access your own settings by going Sublime Text 2 > Preferences > Settings - User or pressing ⌘ + , Then add these to your preferences
{
// This means every time you move away from your current tab it saves, no more cmd + s!
"save_on_focus_lost": true,
// Let's get rid of all those trailing white spaces!
"trim_trailing_white_space_on_save": true,
// A good idea to view all white space to make sure you're not using tabs
"draw_white_space": "all",
@robotslave
robotslave / gist:4633393
Last active March 31, 2025 20:02
How to get Emoji in your Ubuntu Terminal
<!--
1. Download the Android Jelly Bean fonts and the Symbola font:
https://www.dropbox.com/s/tvtzcnzkvbe0nrt/jelly-bean-fonts.zip
http://users.teilar.gr/~g1951d/Symbola707.zip
2. unzip the files and put AndroidEmoji.ttf and Symbola.ttf (and any of the other fonts that strike your fancy)
in your ~/.fonts/ directory
3. run `fc-cache -f`. You can check to make sure the new fonts
were installed with `fc-list`. You'll probably want to grep the copious output for Symbola or Emoji
@cordoval
cordoval / DateRangeType.php
Created December 4, 2012 14:20 — forked from havvg/DateRange.php
Symfony2: poor man's date_range form type
<?php
namespace Ormigo\Bundle\OrmigoBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
@webmozart
webmozart / git-find-merge
Created November 15, 2012 14:32
Script to find the merge and PR a commit occurred in
#!/bin/bash
COMMIT=$1
BRANCH=$2
if [ -z $BRANCH ]; then
BRANCH="master"
fi
perl -ne 'print if ($seen{$_} .= @ARGV) =~ /10$/' \
<(git rev-list --ancestry-path --oneline $COMMIT..$BRANCH) \
@cordoval
cordoval / PopupDictionary.php
Created November 13, 2012 01:34 — forked from blazarecki/PopupDictionary.php
Alert, confirm and prompt with mink
<?php
/**
* @author Benjamin Lazarecki <[email protected]>
* Date: 07/06/12
*/
namespace Widop\Mink\Extension;
trait PopupDictionary