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
@jubianchi
jubianchi / lime.php
Created August 24, 2012 10:49
A tiny hacky loop mode for Lime
#!/usr/bin/env php
<?php
if(count($_SERVER['argv']) === 1 || null === getPath()) {
fwrite(STDOUT, "---> \033[0;31mUsage :\033[0m lime [--quiet] [--no-loop] <path/to/[test_file.php|test_directory]>" . PHP_EOL);
exit(1);
}
function getPath() {
$index = count($_SERVER['argv']) - 1;
@jubianchi
jubianchi / 000-stdout.php
Created October 24, 2012 13:11
PHP & STDOUT
#!/usr/bin/env php
<?php
var_dump(defined('STDOUT'));
var_dump(@fopen('php://stdout', 'w'));
<?php
namespace PMSIpilot\Bundle\StambiaTestBundle\Console\Helper;
use Symfony\Component\Console\Helper\Helper;
class TableFormatterHelper extends Helper
{
/**
* @return string
*/
<?php
use
mageekguy\atoum,
mageekguy\atoum\report\fields\runner\failures\execute\macos
;
$script->addTestAllDirectory(__DIR__ . '/tests');
$cloverWriter = new atoum\writers\file('target/logs/atoum.coverage.xml');
$cloverReport = new atoum\reports\asynchronous\clover();
@jubianchi
jubianchi / git-cstats
Created November 26, 2012 13:18
Get your git usage stats
#!/usr/bin/env php
<?php
$output = $commands = $status = null;
exec('ls /usr/lib/git-core', $commands, $status);
$commands = array_map(function($v) { return str_replace('git-', '', $v); }, $commands);
$output = $reflog = $status = null;
exec('git reflog', $reflog, $status);
printf(" \033[0;34m%s\033[0;32m" . PHP_EOL, 'Git Command Stats v0.1 - Stats computation based on git\'s reflog');
<?php
use \mageekguy\atoum;
function colorized() {
$color = -1;
if(false !== ($term = getenv('TERM'))) {
if(preg_match('/\d+/', $term, $matches) > 0) {
$color = $matches[0];
}
}
@jubianchi
jubianchi / ControllerTest.php
Last active December 9, 2015 22:18 — forked from anonymous/ControllerTest.php
This is an example usage of the AtoumBundle RFC with an improved syntax matching atoum's standards. https://github.com/atoum/AtoumBundle/pull/8 https://github.com/atoum/AtoumBundle/issues/15
<?php
namespace Acme\DemoBundle\Tests\Controller;
require_once __DIR__ . '/../../../../vendor/autoload.php';
require_once __DIR__ . '/../../../../vendor/atoum/atoum/scripts/runner.php';
use atoum\AtoumBundle\Test\Controller;
class DemoController extends Controller\ControllerTest
{
@jubianchi
jubianchi / gist:4353155
Last active December 10, 2015 00:39 — forked from anonymous/gist:4353149
<?php
namespace foo {
interface client
{
public function execute($query, array $params);
}
<?php
namespace jubianchi {
class foo {
public function __construct($foo, $bar) {
echo $foo . '-' . $bar;
}
}
}
namespace tests\units\jubianchi {
@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