Skip to content

Instantly share code, notes, and snippets.

View jeffersongoncalves's full-sized avatar
🎯
Focusing

Jefferson Gonçalves jeffersongoncalves

🎯
Focusing
View GitHub Profile
@jeffersongoncalves
jeffersongoncalves / RouteServiceProvider.php
Created August 8, 2022 22:22
Bind url date format Ymd
<?php
namespace App\Providers;
use Carbon\Carbon;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
<?php
namespace App\Helper;
trait WpTrait
{
/**
* Replaces double line-breaks with paragraph elements.
Please take a look at the original article (http://www.softwareprojects.com/resources/programming/t-optimizing-nginx-and-php-fpm-for-high-traffic-sites-2081.html) as it includes excellent configuration file examples.
1. Switch from TCP to UNIX domain sockets:
When communicating to processes on the same machine UNIX sockets have better performance the TCP because there's less copying and fewer context switches.
2. Adjust Worker Processes:
Set the worker_processes in your nginx.conf file to the number of cores your machine has and increase the number of worker_connections.
3. Setup upstream load balancing:
Multiple upstream backends on the same machine produce higher throughout than a single one.
@jeffersongoncalves
jeffersongoncalves / pint.json
Last active May 16, 2024 16:35 — forked from JustSteveKing/pint.json
Laravel Pint configuration
{
"preset": "psr12",
"rules": {
"align_multiline_comment": true,
"array_indentation": true,
"array_syntax": true,
"binary_operator_spaces": {
"default": "single_space"
},
"blank_line_after_namespace": true,
<?php
namespace Jeffgreco13\FilamentBreezy\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class MustTwoFactor
{
@jeffersongoncalves
jeffersongoncalves / BooksResource.php
Last active March 19, 2024 18:18
Relacionamento N para N
<?php
namespace App\Filament\Resources;
use App\Filament\Resources\BooksResource\Pages;
use App\Filament\Resources\BooksResource\RelationManagers;
use App\Models\Books;
use App\Models\HasCompanies;
use App\Models\User;
use Doctrine\DBAL\Query;
use Filament\Forms;
@jeffersongoncalves
jeffersongoncalves / theme.css
Created September 2, 2024 18:06 — forked from saade/FilamentServiceProvider.php
Filament Custom Theme
@import '/vendor/filament/filament/resources/css/theme.css';
@config 'tailwind.config.js';
html:not(:has(.fi-topbar-with-navigation)) {
.fi-sidebar,
.fi-sidebar-header,
aside {
@apply !ring-0 !shadow-none;
}
@jeffersongoncalves
jeffersongoncalves / .my_setup_oh-my-zsh
Created January 7, 2025 18:01 — forked from andrelugomes/.my_setup_oh-my-zsh
Install oh-my-zsh, plugins and theme
- ok-my-zsh
- p10k.zsh : custon
- .zshrc : Plugins
<?php
namespace App\Traits;
trait PostsPerMonthSeries
{
protected function getChartData(): array
{
return [
'data' => [
@jeffersongoncalves
jeffersongoncalves / devsamurai.sh
Last active January 14, 2025 00:14
Lista de zips das Aulas do devsamurai disponibilizado no class.devsamurai.com.br
wget https://cursos.devsamurai.com.br/Aulas%20ao%20Vivo.zip
wget https://cursos.devsamurai.com.br/Backend%20-%20Dominando%20o%20NodeJS.zip
wget https://cursos.devsamurai.com.br/Backend%20-%20Dominando%20o%20Postgres.zip
wget https://cursos.devsamurai.com.br/Carreira%20de%20Programador.zip
wget https://cursos.devsamurai.com.br/Flutter%20-%20Calculadora%20IMC.zip
wget https://cursos.devsamurai.com.br/Flutter%20-%20Card%C3%A1pio%20online.zip
wget https://cursos.devsamurai.com.br/Flutter%20-%20Fluck%20Noris.zip
wget https://cursos.devsamurai.com.br/Flutter%20-%20Lista%20de%20Leituras.zip
wget https://cursos.devsamurai.com.br/Flutter%20Avan%C3%A7ado.zip
wget https://cursos.devsamurai.com.br/Flutter%20B%C3%A1sico.zip