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 / 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 / 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;
<?php
namespace Jeffgreco13\FilamentBreezy\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class MustTwoFactor
{
@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,
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.
<?php
namespace App\Helper;
trait WpTrait
{
/**
* Replaces double line-breaks with paragraph elements.
@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;
@jeffersongoncalves
jeffersongoncalves / setup.sh
Created March 31, 2022 17:45 — forked from jjvillavicencio/setup.sh
Install Android SDK on Windows Bash (WSL)
cd /home/<user>/
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin
@jeffersongoncalves
jeffersongoncalves / rearct-native-app-in-wsl2.md
Created March 31, 2022 17:45 — forked from bergmannjg/rearct-native-app-in-wsl2.md
Building a react native app in WSL2
@jeffersongoncalves
jeffersongoncalves / README.md
Created March 13, 2022 22:19 — forked from magnetikonline/README.md
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script to:

  • Iterate all commits made within a Git repository.