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
Verifying that +jubianchi is my blockchain ID. https://onename.com/jubianchi
@jubianchi
jubianchi / numbers.php
Last active December 30, 2015 18:48
Mathcing
<?php
$rules = array(
new rule(
array('1', '2', '3'),
array("\033[33m" . '[\1, ', '\2, ', '\3' . "]\033[0m")
),
new rule(
array('3', '2', '1'),
array("\033[33m" . '[\1, ', '\2, ', '\3' . "]\033[0m")
),
From 244d1b4f55116553ca5d529b98251ee643e17340 Mon Sep 17 00:00:00 2001
From: jubianchi <contact@jubianchi.fr>
Date: Thu, 17 Oct 2013 21:09:27 +0200
Subject: [PATCH] Enable prefix annotation
---
classes/test.php | 31 +++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)
diff --git a/classes/test.php b/classes/test.php
<?php
namespace
{
use mageekguy\atoum;
require_once __DIR__ . '/../vendor/autoload.php';
class locker
{
protected $adapter;
<?php
// ----------------------------------------------------------------------------------------
// Testing with internal/SPL classes
$files = array();
$f1 = new \SplFileObject('/home/ABC-OBJECTIF/julien.bianchi/sources/behat_cas/package.json');
$r1 = in_array($f1, $files);
var_dump(spl_object_hash($f1));
@jubianchi
jubianchi / test.php
Last active December 21, 2015 21:48
<?php
namespace {
class A {
private $sep;
public function __construct($sep = null) {
$this->sep = $sep ?: '--';
}
public function concat($a, $b) {
<?php
namespace {
class A {}
var_dump(class_alias('A', 'B')); // => bool(true)
$reflector = new \ReflectionClass('B');
var_dump($reflector->getName()); // => string(1) "A"
}
namespace jubianchi\Alias {
{
"name": "atoum-praspel",
"type": "script",
"description": "",
"authors": [
{
"name": "Julien Bianchi",
"email": "contact@jubianchi.fr",
"homepage": "http://jubianchi.fr"
}
@jubianchi
jubianchi / 00_test.php
Last active December 17, 2015 14:09
AOP-PHP compilation under OS X 10.8.3 with PHP 5.4.11
<?php
aop_add_before('printf()', function($jp) {
echo 'Hey, I\'m being magically called before printf !' . PHP_EOL;
});
aop_add_after('printf()', function($jp) {
echo 'AOP-PHP is really awesome !' . PHP_EOL;
});
aop_add_around('date()', function($jp) {
@jubianchi
jubianchi / usage.sh
Last active December 15, 2015 12:59
# Start your VM either manually or using vboxmanage
#
# /!\ The VM has to be started in non-headless mode for this script to work
# When you want to make it headless (dettached window) use
$ vboxsw "VM Name" d
# When you want to get the window back use
$ vboxsw "VM Name" a