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 / autoload.js
Last active October 5, 2015 07:48
POC nodejs autoloader - `node --harmony_proxies index.js`
"use strict";
module.exports = function autoload() {
try {
require.resolve("harmony-reflect");
} catch (err) {
throw new Error("You should install harmony-reflect module and use the --harmony_proxies flag to use this feature");
}
require("harmony-reflect");

Atoum & PHP7 = <3

PHP7

  • From php-src:
commit db5898c9e55b33c9378295a8a85aa863202996bc
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Aug 24 12:47:06 2015 +0300
<?php
function getIdentity($mixed)
{
return md5(serialize(cleanClosures($mixed)));
}
function cleanClosures($mixed)
{
$values = array();
$ bin/atoum --loop -mcn 3 -ncc -p 'php -n -ddate.timezone=Europe/Paris' -f tests/units/phpunit/AssertTest.php
> PHP path: php -n -ddate.timezone=Europe/Paris
> PHP version:
=> PHP 5.6.6 (cli) (built: May 14 2015 23:27:40)
=> Copyright (c) 1997-2015 The PHP Group
=> Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
> mageekguy\atoum\tests\phpunit\Framework_AssertTest...
[SSS-S0-0000-00-0--000-000-0-00000000000-0------------000-00>][ 59/277]
[--000----0-000000-0-0-0--------------0---00--0-0-0--------->][118/277]
[----------------------------------------------------------->][177/277]
@jubianchi
jubianchi / actual.txt
Created June 11, 2015 13:42
cat test.sql | vendor/bin/hoa compiler:pp sql.pp 0 -s --visitor dump
# namespace token name token value offset
--------------------------------------------------------------------------------
0 default T_SELECT SELECT 0
1 default T_IDENTIFIER foo 7
2 default T_AS AS 11
3 default T_IDENTIFIER bar 14
4 default T_FROM from 18
5 default T_OPAREN ( 23
6 default T_SELECT select 24
7 default T_NUMBER 1 31
export SYMFONY_COMPONENTS_VERSION='3.0.*@dev'
composer create-project --no-install --no-interaction --prefer-dist symfony/framework-standard-edition:${SYMFONY_COMPONENTS_VERSION} sf3_std
composer --working-dir=sf3_std install --prefer-dist
<?php
function foo(\stdClass $a, \stdClass ... $bs)
{
// gestion des arguments sur ma branche (dans le cas des variadics)
var_dump(func_get_args());
// gestion des arguments actuelle
var_dump(array_merge(array($a, $bs), array_slice(func_get_args(), 2)));
}
<?php
namespace mageekguy\atoum\http\tests\functionals\tests\fixtures;
use mageekguy\atoum\http\tests\fixtures\body;
use mageekguy\atoum\http\tests\functional;
class message extends functional
{
public function testProtocol()
{
@jubianchi
jubianchi / php-brew.sh
Last active August 29, 2015 14:11
./php-brew.sh help
#!/bin/bash
if [[ "$1" = "-h" || "$1" = "--help" || $1 = "help" || $1 = "man" ]]
then
echo "A tiny script to run a command against PHP 5.3, 5.4, 5.5 and 5.6 using homebrew"
echo
echo -e "\033[34mUsage:\033[0m"
echo -e "\033[34m------\033[0m"
echo -e " \033[32m$0\033[0m \033[33m<command>\033[0m"
echo
@jubianchi
jubianchi / gitlab-wide.css
Last active August 29, 2015 14:07
gitlab-wide
body > .container,
header .container,
nav .container {
width: 100%;
}
.pull-right .dropdown-menu {
right: 0;
left: auto;
}