Skip to content

Instantly share code, notes, and snippets.

@Fraetor
Fraetor / Debounced search.md
Last active June 22, 2025 12:18
JavaScript implementation of a debounced search box.

Debounced search implementation

A JavaScript search box implementation for real-time search. To ensure smooth searching, the users input is debounced such that the search is only performed when they have completed a search term, unfocused the search box, or not typed anything for half a second.

<input type="search" placeholder="Enter some text" name="name" />
<p id="values"></p>

<script>
  const input = document.querySelector("input");
@Fraetor
Fraetor / install-dotfiles.sh
Last active December 2, 2023 00:12
Installation script for my dotfiles.
#! /bin/sh
set -eu
IFS="$(printf '\n\t')"
# Ask what repository to clone.
printf 'Dotfiles repository URL [git@github.com:Fraetor/dotfiles.git]: '
read -r repo
if [ -z "$repo" ]
then
repo='git@github.com:Fraetor/dotfiles.git'