Skip to content

Instantly share code, notes, and snippets.

View jbdelhommeau's full-sized avatar
🐙
Poulpe fiction

Jean-Baptiste Delhommeau jbdelhommeau

🐙
Poulpe fiction
View GitHub Profile
### 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 / CallMeBaby.php
Last active July 24, 2019 07:19
Phptorm mistake with __invoke function autocomplete and click to go
<?php
namespace App;
use App\InvokeMe;
use App\Dependency2;
class CallMeBaby
{
private $dep2;
@jbdelhommeau
jbdelhommeau / watchers.xml
Last active September 16, 2019 09:34
Fix Php cs fixer with phpstorm Files > Settings > Tools > File Watchers > Import
<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 / gitA2gitB.sh
Created June 23, 2016 12:54
Migrate existing respositories in hub A to Github.
#!/bin/bash
repos="my-repo1
my-repo2
my-repo3"
# Git A source can be github, gitlab
GIT_A='gitlab.com'
GIT_A_ORGANIZATION='miahou'
@jbdelhommeau
jbdelhommeau / tree.php
Last active August 29, 2015 14:22
Show files likes tree command
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)) {
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);
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 August 29, 2015 14:18
Recursive empty
$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 August 29, 2015 14:15
Tab modifier config
{
".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}"
}
}
;Global settings for redshift
[redshift]
; Set the day and night screen temperatures
temp-day=5000
temp-night=3500
; Enable/Disable a smooth transition between day and night
; 0 will cause a direct change from day to night screen temperature.
; 1 will gradually increase or decrease the screen temperature
transition=1