Skip to content

Instantly share code, notes, and snippets.

View saade's full-sized avatar
🦒
FilamentPHP evangelist

Guilherme Saade saade

🦒
FilamentPHP evangelist
View GitHub Profile
@saade
saade / vapor.Dockerfile
Created May 28, 2024 01:52 — forked from mateusjatenee/vapor.Dockerfile
Vapor Dockerfile to install Ghostscript and Imagick while the PECL package is broken
FROM laravelphp/vapor:php83
ARG IMAGICK_VERSION=3.7.0
RUN apk --update add \
ghostscript && \
rm /var/cache/apk/*
RUN curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/refs/tags/${IMAGICK_VERSION}.tar.gz \
&& tar --strip-components=1 -xf /tmp/imagick.tar.gz \
@saade
saade / en-validation.json
Created September 20, 2020 20:20 — forked from diego3g/en-validation.json
Validation
{
"above": "The {{field}} should be above {{argument.0}}.",
"accepted": "The {{field}} should have been accepted",
"after": "The {{field}} should be a date after {{argument.0}}",
"after_offset_of": "The {{field}} should be after {{argument.0}} {{argument.1}} from today’s date",
"alpha": "The {{field}} should contain letters only",
"alpha_numeric": "The {{field}} should contain letters and numbers only",
"array": "The {{field}} should be an ARRAY.",
"before": "The {{field}} should be a date before {{argument.0}}.",
"before_offset_of": "The {{field}} should be before {{argument.0}} {{argument.1}} from today’s date",
@saade
saade / cluster.md
Created December 4, 2018 01:18 — forked from learncodeacademy/cluster.md
Node Cluster - Enhance your node app by using all the cores of your processor.

Here's all you have to do to add clustering to your node.js application.

  • save this code as cluster.js, and run cluster.js instead of server.js (or /bin/www, or whatever it's called for your project)
  • the only line you'll need to change is the last line - it needs to point to the location of your server.js file
var cluster = require('cluster');

if (cluster.isMaster) {
  // Count the machine's CPUs
 var cpuCount = require('os').cpus().length;