Skip to content

Instantly share code, notes, and snippets.

View haggen's full-sized avatar

Arthur Corenzan haggen

View GitHub Profile
@haggen
haggen / index.tsx
Created May 3, 2026 21:51
Simplest JSX as template on Bun
import type { ReactNode } from "react";
import { renderToReadableStream } from "react-dom/server";
function Page({ children }: { children: ReactNode }) {
return (
<html lang="en-us">
<head>
<meta charSet="utf-8" />
<title>Welcome</title>
</head>

Game Launchers Installation Script

This PowerShell script automates the installation of several game launchers and creates symbolic links to redirect their installation directories to a specified games folder.

Prerequisites

  • Windows PowerShell: Ensure that PowerShell is available on your system.
  • Administrator Privileges: The script requires elevated permissions to create symbolic links and modify system folders.
const store = new Map<
() => unknown,
ReturnType<typeof Promise.withResolvers>
>();
/**
* Memoiza função assíncrona, garantindo que mais de 1 chamada concorrente retorne a mesma promessa.
*/
export function memo<T>(f: () => Promise<T>) {
@haggen
haggen / php7.sh
Last active August 12, 2025 21:18
Installing PHP 7 on macOS M4 (ARM) Tahoe Public Beta 2 using brew and mise.
brew install autoconf gmp bison re2c pkg-config libxml2 gd libiconv oniguruma
mise use php@7
@haggen
haggen / starship.toml
Created June 15, 2025 13:31
Starship config file.
format = """
$username\
$hostname\
$localip\
$shlvl\
$singularity\
$kubernetes\
$directory\
$vcsh\
$fossil_branch\
@haggen
haggen / procman.sh
Last active May 19, 2025 16:08
POSIX compliant simplified implementation of foreman (Procfile) in shell script.
#!/usr/bin/env sh
# Halt on error or undefined variables.
set -eu
# Prefix input with a given string.
prefix() {
while IFS= read -r output; do
printf '%s\t%s\n' "$1" "$output"
done
@haggen
haggen / index.html
Created April 26, 2025 10:49
Noise displacement filter in CSS+SVG
<div style="filter: url(#grain)"></div>
<svg xmlns="http://www.w3.org/2000/svg" height="0" width="0">
<defs>
<filter id="grain">
<feTurbulence
type="fractalNoise"
baseFrequency="1"
numOctaves="2"
stitchTiles="stitch"
@haggen
haggen / macros.md
Last active September 25, 2024 00:07
WoW Hunter Macros

1.

#showtooltip
/castsequence [nomod] reset=10 Multi-Shot, Arcane Shot
/use [@mouseover,harm,nodead,mod][mod] Arcane Shot

2.

@haggen
haggen / README.md
Created June 24, 2024 19:00
Fix touchpad/trackpad acceleration Ubuntu/Elementary OS

Using xinput change acceleration profile from adaptive to flat.

  1. Use xinput list and grab touchpad/trackpad device ID.
  2. List properties with xinput watch-props <device id> and grab Accel Profile Enabled ID.
  3. Turn off adaptive profile and turn on flat profile with xinput set-prop <device> <prop> 0 1.

More on https://wiki.archlinux.org/title/Mouse_acceleration

@haggen
haggen / useForm.ts
Created October 21, 2023 18:03
Draft of zod validated form state hook.
import { ChangeEvent, createContext, useMemo, useReducer } from "react";
import { AnyZodObject, ZodError, z } from "zod";
import { mapValues } from "~/lib/map";
type FieldState = {
name: string;
value: string;
error: undefined | ZodError;
touched: boolean;
};