Skip to content

Instantly share code, notes, and snippets.

View luisrodev's full-sized avatar
🤘
Lets go!

Luis Rubio luisrodev

🤘
Lets go!
View GitHub Profile
@acdcjunior
acdcjunior / sha256-hash-nodejs-browser.js
Created May 20, 2024 23:12
Generate sha256 hash for a buffer - browser and node.js
/*
* Sometimes you want to hash stuff on the client and on the server to test if
* data transmission is happening okay. These functions to that.
*/
// node.js
import crypto from 'node:crypto';
async function calculateHashForArrayBuffer(data: ArrayBuffer) {
@dinhquochan
dinhquochan / install.sh
Created July 24, 2023 15:39
Install PHP 8.2, Composer, MySQL 8 for Laravel Development on Ubuntu 22.04
## PHP
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.2-cli php8.2-dev php8.2-pgsql php8.2-sqlite3 php8.2-gd php8.2-imagick \
php8.2-curl php8.2-imap php8.2-mysql php8.2-mbstring php8.2-xml php8.2-zip \
php8.2-bcmath php8.2-soap php8.2-intl php8.2-readline php8.2-ldap php8.2-msgpack \
php8.2-igbinary php8.2-redis php8.2-memcache php8.2-pcov php8.2-xdebug
@jonfk
jonfk / hollow_knight_fix_dualsense.md
Last active September 30, 2025 09:56
Fix to use dualsense controller in hollow knight on linux

Map dualsense controller manually and disable Steam Input

This fixes the issue of swapped buttons and Triggers in the dualsense controller opening the pause menu The issue is caused by the SDL version used by hollow knight not recognizing the dualsense controller and mapping buttons properly. It is also not helped by steam input not disabling the native controller support when used in hollow knight. The issue cannot be fixed by simple mapping in steam input.

  1. Disable Steam Input
  2. Set the following as launch option
@gregorym
gregorym / api.ts
Last active July 16, 2024 13:41
Next.js - Child process
import { NextApiResponse } from 'next';
import { fork } from "child_process";
import path from 'path';
import fs from 'fs';
async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
@hyrious
hyrious / nodejs-on-exit.js
Created November 22, 2020 05:04
how to do something before exit in NodeJS
// only works when there is no task running
// because we have a server always listening port, this handler will NEVER execute
process.on("beforeExit", (code) => {
console.log("Process beforeExit event with code: ", code);
});
// only works when the process normally exits
// on windows, ctrl-c will not trigger this handler (it is unnormal)
// unless you listen on 'SIGINT'
process.on("exit", (code) => {
/* *******************************************************************************************
* PUPPETEER
* https://pptr.dev/
* ******************************************************************************************* */
// When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win)
// that is guaranteed to work with the API.
npm install puppeteer
@raftheunis87
raftheunis87 / hyperjs.md
Last active July 17, 2025 07:10
Hyper.js + Hyper.js Plugins + ZSH + Starship + Fira Code + Dark Theme - (macOS)

Hyper.js

@Villanuevand
Villanuevand / README-español.md
Last active October 26, 2025 22:37
Una plantilla para hacer un buen README.md. Inspirado en el gist de @PurpleBooth => https://gist.github.com/PurpleBooth/109311bb0361f32d87a2

Título del Proyecto

Acá va un párrafo que describa lo que es el proyecto

Comenzando 🚀

Estas instrucciones te permitirán obtener una copia del proyecto en funcionamiento en tu máquina local para propósitos de desarrollo y pruebas.

Mira Deployment para conocer como desplegar el proyecto.

@mkjiau
mkjiau / axios-interceptors-refresh-token.js
Last active September 20, 2025 02:01
Axios interceptors for token refreshing and more than 2 async requests available
let isRefreshing = false;
let refreshSubscribers = [];
const instance = axios.create({
baseURL: Config.API_URL,
});
instance.interceptors.response.use(response => {
return response;
}, error => {
@kocisov
kocisov / next_nginx.md
Last active February 3, 2025 07:27
How to setup next.js app on nginx with letsencrypt