Skip to content

Instantly share code, notes, and snippets.

View webflo-dev's full-sized avatar

Florent webflo-dev

View GitHub Profile
@badsyntax
badsyntax / paths.ts
Last active February 11, 2025 21:41
Fast & Flexible TypeScript dot notation key extraction that supports nested objects to a depth of 10
/**
* Example usage:
*
* // default depth of 3: (fastest)
* type keys = Paths<SomeNestedObject> // returns "property" | "nested.property" | "nested.nested.property"
*
* // depth of 10: (can be slow)
* type keys = Paths<SomeNestedObject, 10>
*
* // depth of 10 with keys of type string and number: (slowest)
@kiliman
kiliman / ErrorBoundary.tsx
Created February 25, 2022 19:03
ErrorBoundary that displays the actual source file and highlights the line
export const ErrorBoundary = ({ error }: any) => {
const [source, setSource] = useState('')
const lines = error.stack.split('\n')
const match = lines[1].match(/(?<path>.+):(?<line>\d+):(?<column>\d+)/)
let path = ''
let linenumber = 0
let column = 0
if (match) {
path = match.groups.path
linenumber = Number(match.groups.line)
@Abdallatif
Abdallatif / remix-field.md
Created November 23, 2021 21:57
Remix Field

This component was inspired by Formik and the jokes demo from Remix. This is just an experiment it's not meant for production use (yet).

interface FormActionData {
  fieldErrors?: Record<string, string>;
  fields?: Record<string, string>;
}

interface Field {
  name: string;
@kiliman
kiliman / README.md
Last active March 26, 2025 23:44
Debug server-side Remix using VSCode

💡 HOWTO: Debug your server-side Remix code using VSCode

✨ New in Remix v1.3.5

The latest release of Remix fixes sourcemaps so you no longer need to use any hacks to set breakpoints in your route modules. Simply start the debugger and Remix will hit the breakpoint in your loaders and actions.

Debugging session even survives edits and Live Reload.

@YoEight
YoEight / improve_fonts.md
Created January 15, 2021 10:11 — forked from j1cs/improve_fonts.md
Improve fonts archlinux

Improve Fonts

Newest

Make your Arch fonts beautiful easily! This is what I do when I install Arch Linux to improve the fonts.

You may consider the following settings to improve your fonts for system-wide usage without installing a patched font library packages (eg. Infinality):

Install some fonts, for example:
sudo pacman -S ttf-dejavu ttf-liberation noto-fonts

@thugcee
thugcee / sxhkdrc
Last active May 18, 2022 09:46 — forked from jpentland/tabc.sh
Suckless' tabbed integration with BSPWM. This configuration supports joining any two neighbouring windows into a new tabbed, removing windows from tabbed and when last window is from tabbed removed then tabbed instance is closed. This slightly modified `tabc.sh` allows to omit id of the removed window (the current one is removed by default).
# Remove current tab from tabbed
super + mod1 + t; r
tabc.sh $(bspc query -N -n focused) remove
# At given direction: join two windows into a new tabbed or add window to an existing tabbed
super + mod1 + t; {Left,Down,Up,Right}
tabc.sh $(bspc query -N -n {west,south,north,east}) add $(bspc query -N -n focused)
@blurayne
blurayne / ui-widget-select.sh
Last active May 21, 2025 20:15
Pure BASH interactive CLI/TUI menu (single and multi-select/checkboxes)
#!/bin/bash
##
# Pure BASH interactive CLI/TUI menu (single and multi-select/checkboxes)
#
# Author: Markus Geiger <[email protected]>
# Last revised 2019-09-11
#
# ATTENTION! TO BE REFACTORED! FIRST DRAFT!
#
@bakkujp
bakkujp / Install_Docker_On_Alpine_Linux_3.10.md
Last active July 10, 2024 03:08
How to install Docker on Alpine Linux 3.10
@SidharthArya
SidharthArya / alttab
Last active July 9, 2025 15:40
Sway Windows Manager Alt Tab behavior
#!/usr/bin/env python3
import sys
import json
import subprocess
direction=bool(sys.argv[1] == 't' or sys.argv[1] == 'T')
swaymsg = subprocess.run(['swaymsg', '-t', 'get_tree'], stdout=subprocess.PIPE)
data = json.loads(swaymsg.stdout)
current = data["nodes"][1]["current_workspace"]
@TomFaulkner
TomFaulkner / ubuntu18.04-vfio.md
Last active May 20, 2025 07:47
VFIO Setup on Ubuntu 18.04