Skip to content

Instantly share code, notes, and snippets.

View jwcastillo's full-sized avatar
🏠
Working from home

José Wenceslao Castillo jwcastillo

🏠
Working from home
View GitHub Profile
@jwcastillo
jwcastillo / deploy-sh__git.md
Created July 7, 2025 16:07 — forked from roadev/deploy-sh__git.md
Automatizar deploy a servidor (VPS) con git

Aquí explicaré cómo realizar un deploy automático en servidor (VPS de DigitalOcean). Realizaremos un push primero a github y necesitaremos una conexión ssh para poder jalar automáticamente desde el servidor de deploy. Para comenzar, debemos tener nuestra llave ssh agregada en github, así que seguimos los siguientes pasos (ésto si nunca lo hemos hecho...).

En nuestro equipo, ejecutamos:

ssh-keygen

Con ello generamos una clave ssh en nuestro directorio home, si ya la tenemos la terminal les preguntará si quieren sobre-escribir la llave. Elegimos según corresponda (nota, si ya está generada, tener en cuenta si se ha usado con otros servidores o para otro tipo de autenticación...). Nos pedirá una passphrase, la cuál no es más que una contraseña segura que deseemos colocarle a nuestra llave privada.

@jwcastillo
jwcastillo / asdf-php.md
Created July 2, 2025 12:12 — forked from muhajirinlpu/asdf-php.md
asdf php laravel compatible install ubuntu & arch linux

This setup is suitable for Laravel

Install Requirements

  • ubuntu
sudo apt update && sudo apt install -y autoconf bison build-essential locate curl gettext git libgd-dev libcurl4-openssl-dev libedit-dev libicu-dev libjpeg-dev libmysqlclient-dev libonig-dev libpng-dev libpq-dev libreadline-dev libsqlite3-dev libssl-dev libxml2-dev libzip-dev libsodium-dev openssl pkg-config re2c zlib1g-dev
  • arch
@jwcastillo
jwcastillo / prom.sh
Created April 18, 2025 19:16 — forked from Lucho00Cuba/prom.sh
Prometheus API cURL
#!/usr/bin/env bash
PROTOCOL="http"
PROMETHEUS="192.168.1.203:9090"
OPTIONS="-sL"
query_http(){
name=$1; request=$2; args=$3
echo $name
echo "Requests: curl $OPTIONS -G $request $args 2>/dev/null"

Everything I do in this guide is mostly taken from the Arch Wiki, and is for Arch Linux, obviously this can probably be applied to other Linux distributions especially Arch based ones, this guide is for people who want a laptop with similar effciency they had on Windows or MacOS. I hate the excuse of having to compromise on Linux to have good battery or thermals on laptops.

Please think of this guide as more of a starting point, if you're serious about fully optimizing your laptop research your laptop and the hardware inside of it as that can get you even further down the rabbit hole.

This guide assumes you have a relatively modern laptop with at least an SSD from the factory, if you don't, don't worry you can still probably follow this guide perfectly, if you have 32-bit laptop I'm using 64-bit packages only, but there should be 32-bit packges in the Arch multilib repo, **just don't assume everything will work or not break your laptop, please read carefully, and don't copy and paste commands or edit co

---
description: >
Git Commit Assistant rule to enforce clean,
structured, and traceable commit workflows. This rule should be applied
whenever a developer attempts to stage or commit changes. It ensures that:
- Commits are grouped logically and use conventional commit messages tied to Jira tickets.
- Feature branches are created from `development` with proper naming conventions.
- No direct work is allowed on `master`.
- Sensitive or excluded files (e.g., .env, secrets) are never accidentally committed.
This rule improves collaboration, auditability, and consistency across the codebase,
@jwcastillo
jwcastillo / publishing-pull-requests.md
Created April 9, 2025 02:21 — forked from hcastro/publishing-pull-requests.md
Best Practices for Publishing Pull Requests in Modern Software Teams

Introduction

Pull requests (PRs) are a cornerstone of collaboration in modern software engineering. A well-crafted PR not only merges code but also communicates context and invites engagement from reviewers. In teams building applications across React Native (mobile), Next.js (web), and Node.js (backend), clear PR communication ensures that all team members – regardless of specialty – can understand and review changes effectively. In fact, a PR’s description and structure can be as valuable as the original task specification (How to Make a Proper Description for a Pull Request). High-quality PRs save time in reviews and reduce back-and-forth clarifications, leading to faster approvals and a healthier code review culture ([How to Make a Proper Description for a Pull Request](https://maddevs.io/blog/how-to-make-a-proper-description-for-a-pull-request/#:~:text=As%20a%20rev

@jwcastillo
jwcastillo / function.mjs
Created January 28, 2025 14:39 — forked from susisu/function.mjs
CloudFront Function for websites using CloudFront + S3 + Next.js static export (as of v13)
/* eslint-disable no-var, vars-on-top, no-param-reassign */
function redirect(uri) {
// remove repeated slashes
uri = uri.replace(/\/+/g, "/");
// remove trailing slash
if (uri !== "/" && uri.endsWith("/")) {
uri = uri.slice(0, -1);
}
return uri;

Install oh-my-zsh on OpenWrt

Install Requirements Packages

opkg update && opkg install ca-certificates zsh curl git-http

Install oh-my-zsh

Install oh-my-zsh on OpenWrt

Install Requirements Packages

opkg update && opkg install ca-certificates zsh curl git-http

Install oh-my-zsh

{
"barmode": "stack",
"legend": {
"bgcolor": "#fff",
"orientation": "h"
},
"margin": {
"b": 30,
"l": 45,
"pad": 4,