Skip to content

Instantly share code, notes, and snippets.

View lokinmodar's full-sized avatar
🎯
Focusing

Dante Souza e Souza lokinmodar

🎯
Focusing
View GitHub Profile
// Turn all HTML <a> elements into client side router links, no special framework-specific <Link> component necessary!
// Example using the Next.js App Router.
import { useRouter } from 'next/navigation';
import { useEffect } from 'react';
function useLinkHandler() {
let router = useRouter();
useEffect(() => {
let onClick = e => {
@rcapeto
rcapeto / vtex.custom-component.md
Last active August 7, 2025 22:46
VTEX Custom-Component Documentation.

⚛️ Custom Component Documentation

Creating a Custom Component

  1. First create a file in /react/components/{filename}
@caleywoods
caleywoods / 00_readme.md
Last active August 12, 2024 17:42
Google script to allow voting on a google sheet document.

Vote on Google Sheet

There are some expectations:

  • Score column needs to be configured, column A is 1, column B is 2, etc.
  • Upvote and downvote columns need to be configured in the same way
  • Within your sheet, insert an image into the cells for upvote/downvote. I like to use google image search within the sheets interface to add "up arrow" and "down arrow". You want to use images because you can drag down the corners to autofill the images into new rows as new data is added to the sheet
@Zeffuro
Zeffuro / FFXIVIdaGuide.md
Last active July 4, 2025 11:18
FFXIV IDA Bruteforce Guide

IDA Bruteforce Guide (written by someone who is totally clueless and just wanted to get stuff working)

How to set up the environment.

  1. Get IDA Pro from somewhere, in this "guide" I use IDA Pro 7.5
  2. Install Python 3.5 or newer, in this "guide" I use Python 3.8.5
  3. Download pySigMaker.py or SigMaker, in this "guide" I use pySigMaker.
  4. Clone or download latest FFXIVClientStructs
  5. Copy pySigMaker.py in IDA Install Directory\Plugins
@tdcosta100
tdcosta100 / WSL2GUIXvnc-en.md
Last active October 10, 2025 05:24
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen

WSL2 with GUI using Xvnc

Note

If you want to use pure WSLg, you can try the new WSLg (XWayland) tutorial or the WSLg (Wayland) tutorial.

In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).

The key component we need to install is the desktop metapackage you want (GNOME, KDE, Xfce, Budgie, etc) and tigervnc-standalone-server.

For this setup, I will use Ubuntu (20.04, 22.04 and 24.04 are working), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the [Sample

[wsl2]
kernel=C:\\Users\\JAKA\\vmlinux
@kuzminero
kuzminero / emuparadise_dc_fix2
Created November 6, 2019 00:43
emuparadise_dc_fix2
// ==UserScript==
// @name emuparadise_dc_fix2
// @version 1.0
// @description Workaround for downloading Dreamcast roms from Emuparadise.me
// @author ichkommepostal
// @match https://www.emuparadise.me/Sega_Dreamcast_ISOs/*/*
// @grant none
// ==/UserScript==
(function() {
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active October 30, 2025 15:37
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@sebmarkbage
sebmarkbage / The Rules.md
Last active October 25, 2025 11:39
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

@joaohcrangel
joaohcrangel / validation-cpf.ts
Last active October 14, 2025 00:37
Função para validar CPF em TypeScript
function isValidCPF(value: string) {
if (typeof value !== 'string') {
return false;
}
value = value.replace(/[^\d]+/g, '');
if (value.length !== 11 || !!value.match(/(\d)\1{10}/)) {
return false;
}