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 / 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,
@jwcastillo
jwcastillo / sane-caching.nginx.conf
Created March 15, 2023 07:28 — forked from philipstanislaus/sane-caching.nginx.conf
Sample Nginx config with sane caching settings for modern web development
# Sample Nginx config with sane caching settings for modern web development
#
# Motivation:
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools.
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh
# and juicy version of your assets available.
# At some point, however, you want to show your work to testers, your boss or your client.
# After you implemented and deployed their feedback, they reload the testing page – and report
# the exact same issues as before! What happened? Of course, they did not have developer tools
# open, and of course, they did not empty their caches before navigating to your site.
@jwcastillo
jwcastillo / update-all-asdf-plugins.sh
Created March 1, 2023 01:33 — forked from ig0rsky/update-all-asdf-plugins.sh
Update all asdf plugins to latest
#!/usr/bin/env bash
function log () {
printf "%s %s\n" "->" "$1"
}
log "Updating all asdf-plugin remotes..."
asdf plugin update --all