Skip to content

Instantly share code, notes, and snippets.

@dib258
dib258 / .php-cs-fixer.dist.php
Created February 4, 2022 11:19
PHP-CS-Fixer Remote config file to lint with Github Action
<?php
$rules = [
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => true,
@dib258
dib258 / settings.json
Last active February 4, 2022 13:24
Visual Studio Code - User Settings, configuration of ESLint to lint with vetur and PHP-CS-Fixer
{
/**
* Vue Linting - Vetur
*/
"html.format.enable": false,
"vetur.format.options.tabSize": 4,
"vetur.format.scriptInitialIndent": true,
"vetur.format.styleInitialIndent": true,
"vetur.validation.template": false,
@dib258
dib258 / php-cs-fixer.yml
Created February 3, 2022 17:22
Github Action file that use php-cs-fixer to lint project on the repository
name: PHP-CS-Fixer Lint
on: [push]
jobs:
php-linter:
name: PHP Linter
runs-on: ubuntu-latest
@dib258
dib258 / eslint.yml
Created February 3, 2022 17:19
Github Action file that runs Eslint linter on the project
# This is a basic workflow to help you get started with Actions
name: ESLint
# Controls when the workflow will run
on:
push
# Triggers the workflow on push or pull request events but only for the main branch
# on: [push, pull_request]
@dib258
dib258 / data_get.php
Last active December 15, 2020 20:48
Laravel Helper
<?php
function data_get($target, $key, $default = null)
{
if (is_null($key)) {
return $target;
}
$key = is_array($key) ? $key : explode('.', $key);
@dib258
dib258 / cloudSettings
Last active August 6, 2020 22:31
VSCode current configuration
{"lastUpload":"2020-08-06T22:31:00.651Z","extensionVersion":"v3.4.3"}
@dib258
dib258 / exo3.php
Last active March 26, 2019 22:11
Boss Video Game Richest
<?php
ini_set('memory_limit', '8192M');
/*******
* Read input from STDIN
* Use echo or print to output your result to STDOUT, use the PHP_EOL constant at the end of each result line.
* Use:
* fwrite(STDERR, "hello, world!" . PHP_EOL);
* or
* error_log("hello, world!" . PHP_EOL);
* to output debugging information to STDERR
@dib258
dib258 / AppServiceProvider.php
Last active January 27, 2019 01:44
Custom Blade directive that currently need to pass variable name by argument
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Illuminate\View\Compilers\BladeCompiler;
class AppServiceProvider extends ServiceProvider
{
@dib258
dib258 / AccessibilityMapPictureGenerator.php
Created January 17, 2019 17:52
Extract database to script node
<?php
protected function extractMarkerstoJson() {
$markersArray = [];
foreach($this->markers as $marker) {
$markerObject = new stdClass();
$markerObject->id = $marker->id;
$markerObject->type = $marker->type;
$markerObject->subtype = $marker->subtype;
@dib258
dib258 / gist:00f2e0c66b5f3b8dda75f78ec8994d1e
Created August 29, 2018 10:40
git hist command and color
git config --global alias.hist "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
git config --global alias.histlong "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"
iTerm Color :
Black #202020/#555555
Red: #5d1a14/#da4939
Green: #424e24/#a5c261
Yellow: #6f5028/#ffc66d
Blue: #263e4e/#6d9cbe