Skip to content

Instantly share code, notes, and snippets.

@josenetoz
josenetoz / setup.md
Created April 14, 2025 12:11
Linux + Laravel Sail + Laravel Pint Watcher

Para rodar o Linux + Laravel Sail + Laravel Pint com Wacther do PHPStorm

  1. Crie um Custom File Watcher
  2. Em Tool to Run:
    1. Program: Adiciona o caminho completo para o executável do sail CAMINHO_DO_PROJETO/vendor/bin/sail
    2. Arguments: Adicione pint $FileRelativePath$
    3. Output path to refresh: Adicione $FilePath$
    4. Working Directory: Adicione $ProjectFileDir$
    5. Environment Variables: Adicione COMPOSE_INTERACTIVE_NO_CLI=1
  3. Desabilite o caixa de Auto Save
@aguinaldotupy
aguinaldotupy / .env
Last active April 11, 2025 23:15
Docker Laravel Octane / PHP 8.4 / Swoole
OCTANE_SERVER="swoole"
OCTANE_HTTPS="true"
WWWGROUP=1004
WWWUSER=1004
<?php
namespace App\Traits;
trait PostsPerMonthSeries
{
protected function getChartData(): array
{
return [
'data' => [
@JustSteveKing
JustSteveKing / pint.json
Last active June 8, 2025 04:06
Laravel Pint configuration
{
"preset": "per",
"rules": {
"align_multiline_comment": true,
"array_indentation": true,
"array_syntax": true,
"blank_line_after_namespace": true,
"blank_line_after_opening_tag": true,
"combine_consecutive_issets": true,
"combine_consecutive_unsets": true,
<?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;
@webdevmatics
webdevmatics / Datatable.php
Created October 11, 2020 18:34
Livewire datatable #livewire
<?php
namespace App\Http\Livewire;
use App\Product;
use Livewire\Component;
use Livewire\WithPagination;
class Datatable extends Component
{
@tanthammar
tanthammar / session-timeout-alert-after-livewire-scripts.blade.php
Last active November 23, 2023 11:50
Laravel Livewire Turbolinks Blade component to keep session alive
{{-- You do not need to add this component if you are using the permanent option in the head component --}}
<script>
if (!window.sessionTimerPermanent && window.Livewire) {
window.livewire.hook('afterDomUpdate', startSessionTimer)
}
// if you are on livewire > 1.3.1 and want to avoid the default error alert
// https://github.com/livewire/livewire/pull/1146
window.livewire.onError(statusCode => {
if (statusCode === 419) {
@bergmannjg
bergmannjg / rearct-native-app-in-wsl2.md
Last active June 17, 2025 23:59
Building a react native app in WSL2
@andrelugomes
andrelugomes / .my_setup_oh-my-zsh
Last active January 7, 2025 18:01
Install oh-my-zsh, plugins and theme
- ok-my-zsh
- p10k.zsh : custon
- .zshrc : Plugins