Skip to content

Instantly share code, notes, and snippets.

View WendellAdriel's full-sized avatar
💻
Working...

Wendell Adriel WendellAdriel

💻
Working...
View GitHub Profile
@WendellAdriel
WendellAdriel / .php-cs-fixer.dist.php
Created May 17, 2024 11:52
Default PHP CS Fixer configuration for my projects
<?php
$finder = Symfony\Component\Finder\Finder::create()
->in([
__DIR__ . '/src',
])
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
@WendellAdriel
WendellAdriel / pint.json
Created May 18, 2023 17:15
Default Pint configuration for my projects
{
"preset": "laravel",
"rules": {
"array_push": true,
"assign_null_coalescing_to_coalesce_equal": true,
"combine_consecutive_issets": true,
"combine_consecutive_unsets": true,
"concat_space": {
"spacing": "one"
},
<?php
namespace App\Providers;
use Illuminate\Auth\EloquentUserProvider;
use Illuminate\Contracts\Auth\Authenticatable as UserContract;
class UserProvider extends EloquentUserProvider
{
/**
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
@WendellAdriel
WendellAdriel / docker-compose.yml
Created April 17, 2017 13:06
Docker Compose PHP - Nginx - Elasticsearch
version: "3"
services:
web:
image: nginx:latest
container_name: elastic-test-web
ports:
- "8080:80"
volumes:
- ./app:/app
@WendellAdriel
WendellAdriel / Client.php
Created February 8, 2017 12:25
Simple many-to-many laravel 5 example
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Client extends Model
{
public function tickets()
{
@WendellAdriel
WendellAdriel / balance_string.js
Created December 27, 2016 11:14
Function to know if the given string is balanced or not
/**
* PROBLEM:
* Create a function that receives a string like "[[[]]]" or "[][]][" and returns true if the string is balanced
* or false if the string isn't (to be balanced the string must have the same number of opening and closing brackets
* and they must be in the correct order). For example the first given string must return true and the second one must
* return false.
*/
const isStringBalanced = string => {
return !string.split('').reduce((previous, char) => {
if (previous < 0) return previous;