Skip to content

Instantly share code, notes, and snippets.

View bulton-fr's full-sized avatar

Vermeulen Maxime bulton-fr

View GitHub Profile
@bulton-fr
bulton-fr / With child method.php
Last active November 21, 2015 15:54
Time to call parent class
<?php
class Foo
{
//somes attributes and methods
public function display()
{
//somes actions...
}
}
@bulton-fr
bulton-fr / bench_mysql_data_formats.md
Created November 21, 2015 15:51
Bench mysql 1 column vs multi columns
mysql  Ver 14.14 Distrib 5.6.25, for debian-linux-gnu (x86_64) using  EditLine wrapper
CREATE TABLE bench_columns (
 id int(11) NOT NULL AUTO_INCREMENT,
 gender varchar(6) NOT NULL,
 title varchar(4) NOT NULL,
 first varchar(255) NOT NULL,
@bulton-fr
bulton-fr / add var on global scope.php
Created May 15, 2016 10:27
Test to create var in global scope from class method
<?php
/**
* Test with https://3v4l.org/ZWMBt#v500
*
* $test3 is created for 5.0.0 - 5.6.21, hhvm-3.9.1 - 3.12.0, 7.0.0 - 7.0.6
*/
$test1 = 'test1';
@bulton-fr
bulton-fr / CI3_ref_is_not_necessary.php
Created July 3, 2016 19:36
code igniter develop : function load_class
<?php
/**
* @see : https://github.com/bcit-ci/CodeIgniter/blob/develop/system/core/Common.php#L141
* Return a reference is useless !
* To explain : https://youtu.be/_84eIkA3j54?t=13m48s
*/
//Code example:
@bulton-fr
bulton-fr / bfw-migrate-2.2-to-3.0
Last active October 1, 2016 19:32
Script to migrate a BFW application from 2.2 to 3.0
#!/bin/php
<?php
/**
* Convert directories structure from BFW 2.2 to BFW 3.0
*
* @project BFW
* @author bulton-fr <bulton.fr@gmail.com>
*/
function confirmPath($path, $pathName, $argumentName)
#!/bin/sh
set -e
juniper_connected() {
echo "Connected action - Add google dns to resolv.conf"
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
echo "nameserver 8.8.4.4" >> /etc/resolv.conf
}
case "$1" in
<?php
namespace Test {
trait SoapCall {
protected $test = '';
}
class Test {
use \Test\SoapCall;
}
@bulton-fr
bulton-fr / errors.php
Last active August 16, 2018 14:14
BFW v3 config file without comments
<?php
/**
* Config file for errors system
*
* @author bulton-fr <bulton.fr@gmail.com>
* @version 3.0.0
* @package bfw
*/
return [
'errorRenderFct' => [
@bulton-fr
bulton-fr / delicous_export.sh
Last active April 10, 2017 20:43
del.icio.us Export
#!/bin/bash
NB_PAGES=28 #Replace by the number of the page for your account
ALL_PIDS=""
# Replace "yourValueHere" by your cookie value
COOKIES="loginemail=\"yourValueHere\";delavid=yourValueHere;H1:yourValueHere=1;sm_dapi_session_yourValueHere=1;delvisitor=\"yourValueHere\";session=yourValueHere"
AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36"
for PAGE in $(seq 1 $NB_PAGES)
@bulton-fr
bulton-fr / cleanTwitterTL.js
Last active August 29, 2017 10:52
Twitter Clean Timeline
//Remove liked suggest tweet
const allTweetSuggest = document.querySelectorAll('div[data-component-context="suggest_activity_tweet"]');
const nbSuggest = allTweetSuggest.length;
let suggestTweet;
for (let suggestLoopIndex = 0; suggestLoopIndex < nbSuggest; suggestLoopIndex++) {
suggestTweet = allTweetSuggest[suggestLoopIndex];
suggestTweet.parentNode.remove();
}