Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / cloudSettings
Last active August 6, 2020 22:31
VSCode current configuration
{"lastUpload":"2020-08-06T22:31:00.651Z","extensionVersion":"v3.4.3"}
@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 / 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 / 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 / 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.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,