Skip to content

Instantly share code, notes, and snippets.

Avatar
🐙
Poulpe fiction

Jean-Baptiste Delhommeau jbdelhommeau

🐙
Poulpe fiction
View GitHub Profile
View gist:ffcb1214102c0e6a96815a011a65ae65
### Keybase proof
I hereby claim:
* I am jbdelhommeau on github.
* I am jbdelhommeau (https://keybase.io/jbdelhommeau) on keybase.
* I have a public key ASBKSomRtYHgYh63zHILfkl1VQgzuqzrMkYRjgOt6e5hKwo
To claim this, I am signing this object:
@jbdelhommeau
jbdelhommeau / watchers.xml
Last active Sep 16, 2019
Fix Php cs fixer with phpstorm Files > Settings > Tools > File Watchers > Import
View watchers.xml
<TaskOptions>
<TaskOptions>
<option name="arguments" value="fix --path-mode=intersection --using-cache=no $FilePathRelativeToProjectRoot$" />
<option name="checkSyntaxErrors" value="true" />
<option name="description" />
<option name="exitCodeBehavior" value="ERROR" />
<option name="fileExtension" value="php" />
<option name="immediateSync" value="false" />
<option name="name" value="Php cs fixer" />
<option name="output" value="$FilePathRelativeToProjectRoot$" />
@jbdelhommeau
jbdelhommeau / CallMeBaby.php
Last active Jul 24, 2019
Phptorm mistake with __invoke function autocomplete and click to go
View CallMeBaby.php
<?php
namespace App;
use App\InvokeMe;
use App\Dependency2;
class CallMeBaby
{
private $dep2;
@jbdelhommeau
jbdelhommeau / gitA2gitB.sh
Created Jun 23, 2016
Migrate existing respositories in hub A to Github.
View gitA2gitB.sh
#!/bin/bash
repos="my-repo1
my-repo2
my-repo3"
# Git A source can be github, gitlab
GIT_A='gitlab.com'
GIT_A_ORGANIZATION='miahou'
View robot.js
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@jbdelhommeau
jbdelhommeau / tree.php
Last active Aug 29, 2015
Show files likes tree command
View tree.php
public function tree()
{
$nbFiles = iterator_count($this->getInnerIterator());
if ($this->io && $nbFiles > 0) {
$this->io->write('.');
$currentDir = array();
$depth = $countDir = 0;
foreach ($this->getInnerIterator() as $key => $file) {
$relativePath = $file->getRelativePath();
if (empty($relativePath)) {
View test.js
this.context.treePath = [1,2,3];
EAD.prototype.treePath = function() {
var treePath = this.context.treePath;
_.forEach(this.context.path, function(n) {
if (treePath[n] === undefined) {
treePath[n] = {};
}
treePath = treePath[n];
}, this);
View example.php
private function getFieldDataValue(NoticeDataLang $fieldData)
{
if ($fieldData->getField()->getType() !== Field::TYPE_SET) {
return [$fieldData->getField()->__toForm() => $fieldData->getValue(false)];
}
if ($fieldData->getChildren()) {
$childData = [];
foreach ($fieldData->getChildren()->toArray() as $child) {
array_push($childData, [$child->getPart() => $this->getFieldDataValue($child)]);
@jbdelhommeau
jbdelhommeau / is_empty.php
Last active Aug 29, 2015
Recursive empty
View is_empty.php
$field1 = array(
array('field_14' => null, 'field_21' => array(array('field_22' => null, 'field_23' => null, 'field_24' => null)), 'field_19' => null, 'field_20' => null)
);
$field2 = array();
$field3 = array('field' => 'test');
$field4 = 'coucou';
@jbdelhommeau
jbdelhommeau / tabModifier
Last active Aug 29, 2015
Tab modifier config
View tabModifier
{
".insitu.sgm.mnesys.fr": {
"title": "[DEV] {title}",
"icon": "http://www.favicon.cc/favicon/414/753/favicon.png"
},
"pma.insitu.sgm.mnesys.fr": {
"title": "{title}",
"icon": "{default}"
}
}