Skip to content

Instantly share code, notes, and snippets.

View andremsantos's full-sized avatar

André Santos andremsantos

  • Docinho de Açucar
  • Portugal
View GitHub Profile
@markshust
markshust / README.md
Last active August 15, 2025 21:50
Zero-downtime Laravel deployment with GitHub Actions

GitHub Actions Deploy Script - Environment Variables Setup Guide

This guide explains how to set up the required environment variables (GitHub Secrets) for the Laravel deployment GitHub Actions workflow.

Overview

The deployment script uses GitHub Secrets to securely store sensitive information like SSH keys and server details. These secrets are referenced in the workflow using the ${{ secrets.SECRET_NAME }} syntax.

Required Secrets

@xelaz
xelaz / resize.js
Last active September 5, 2022 07:27
NodeJs resize and optimize images with sharp
const fs = require('fs');
const glob = require('glob');
const sharp = require('sharp');
const Promise = require('bluebird');
const successList = [];
const errorList = {};
glob("wp-content/uploads/**/*.+(jpeg|jpg)", function (er, files) {
Promise.resolve(files)
@scottopolis
scottopolis / splice-object-array.js
Last active July 4, 2025 13:21
Remove object from array of objects in Javascript
// we have an array of objects, we want to remove one object using only the id property
const apps = [{id:34,name:'My App',another:'thing'},{id:37,name:'My New App',another:'things'}];
// get index of object with id of 37
const removeIndex = apps.findIndex( item => item.id === 37 );
// remove object
apps.splice( removeIndex, 1 );
@dtomasi
dtomasi / default
Last active July 28, 2025 13:14
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}