Skip to content

Instantly share code, notes, and snippets.

View dragenet's full-sized avatar

Dragenet dragenet

View GitHub Profile
@dragenet
dragenet / performanceTest.js
Last active February 7, 2024 13:58
JS function performance testing util
// UTIL START
const test = (label, fn, attempts = 50, verbose = false) => {
const executionsTimeAccumulator = []
let min = null
let max = null
Array(attempts)
.fill(null)
.forEach((_, index) => {
const start = performance.now()
@dragenet
dragenet / mouse_emulator.ps1
Last active February 6, 2023 15:21
Script to emulate mouse movements -
# launch powershell and paste or launch from file this script
Add-Type -AssemblyName System.Windows.Forms
$fc = (-1, 1 | Get-Random)
while ($true)
{
$Pos = [System.Windows.Forms.Cursor]::Position
$x = ($pos.X) + (Get-Random -Minimum -5 -Maximum 5) * $fc
$y = ($pos.Y) + (Get-Random -Minimum -5 -Maximum 5) * $fc
if($x -eq 0 -Or $y -eq 0) {
@dragenet
dragenet / mapPathToObject.js
Last active April 9, 2022 20:43
Map path array to object, usefull to parse zod error to react-hook-form errors
/*
Example mapping
Input:
path = ['body', 'email']
message = 'MESSAGE'
Output:
{
body: {
@dragenet
dragenet / keybase.md
Created March 24, 2022 13:01
keybase.md

Keybase proof

I hereby claim:

  • I am dragenet on github.
  • I am dragenet (https://keybase.io/dragenet) on keybase.
  • I have a public key whose fingerprint is C4F6 C4CA 05FB 0FA2 66C2 FA7E A256 A864 B9D8 C2B6

To claim this, I am signing this object:

@dragenet
dragenet / .gitignore
Last active February 4, 2021 11:06
Gitignore snipper for ignore all .env.* except .env.example
.env*
!.env.example