Skip to content

Instantly share code, notes, and snippets.

View DmACKGL's full-sized avatar
🖥️
Code, Code & Code.

Franco Sanllehi DmACKGL

🖥️
Code, Code & Code.
  • Valparaiso, Chile
View GitHub Profile
@KristofferEriksson
KristofferEriksson / useConfirmation.ts
Created January 23, 2024 10:11
Custom React hook for double-click confirmation for critical actions
import { useCallback, useEffect, useRef, useState } from "react";
/**
* Custom React hook for double-click confirmation for critical actions.
*
* @param action - The action to be executed on the second click.
* @param timeout - Time in milliseconds to reset the unlocked state.
* @returns The current unlocked state and the trigger function.
*/
const useConfirmation = (action: () => void, timeout: number = 5000) => {
@jbovet
jbovet / registrocivil.py
Last active March 22, 2024 16:41
Consulta de estado de documento de identidad registro civil Chile
import requests,urllib3, sys
from bs4 import BeautifulSoup
if len(sys.argv) < 3:
print('Usage: python registrocivil.py run docType docNumber')
sys.exit('ex: python registrocivil.py 11111111-K CEDULA 10600000')
URL="https://portal.sidiv.registrocivil.cl/usuarios-portal/pages/DocumentRequestStatus.xhtml"
headers={"Content-Type":"application/x-www-form-urlencoded",
"User-Agent":"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"}