Skip to content

Instantly share code, notes, and snippets.

View ghsolutions's full-sized avatar

G. Dinnebier ghsolutions

View GitHub Profile
@ghsolutions
ghsolutions / 01-directory-structure.md
Created September 7, 2024 17:51 — forked from tracker1/01-directory-structure.md
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@ghsolutions
ghsolutions / Kernel.php
Created September 7, 2024 17:49 — forked from JuanDMeGon/Kernel.php
A small Laravel command to collect the sessions garbage if applicable to the current session driver
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
//...
@ghsolutions
ghsolutions / README.md
Created September 7, 2024 17:48 — forked from rolandstarke/README.md
Laravel less cookies in response

Laravel less Cookies in Response

Laravel sends the session and csrf cookie in every response. That is additional trafic that's not needed. With this changes the session cookie and csrf cookie don't get resend to the client every time if they did not change (but at least once an hour to prevent client side expiring).

@ghsolutions
ghsolutions / README.md
Created September 7, 2024 17:47 — forked from rolandstarke/README.md
Faster Laravel File Cache Garbage Collector

Laravel File Cache Garbage Collector

Command to delete old expired cache files.

When using the file cache driver, Laravel creates the cache files but never purges expired ones. This can lead to a situation where you have a large number of unused and irrelevant cache files, especially if you do a lot of short-term caching in your system.

Install

@ghsolutions
ghsolutions / Nginx FastCGI Cache.md
Created September 7, 2024 17:47 — forked from rolandstarke/Nginx FastCGI Cache.md
Serve Laravel from the Nginx cache

Nginx FastCGI Cache with Laravel

Serve dynamicaly generated files from Laravel from the Nginx cache.

Nginx config

docs

# sudo nano /etc/nginx/sites-available/default
@ghsolutions
ghsolutions / laravel setup.sh
Created September 7, 2024 17:47 — forked from rolandstarke/laravel setup.sh
Server setup bash script for Laravel
# Ubuntu 20 LTS Server Setup for Laravel
# Login as root user
sudo su -
# Update list of available packages
apt update