Skip to content

Instantly share code, notes, and snippets.

View gvangool's full-sized avatar

Gert Van Gool gvangool

View GitHub Profile
@jessfraz
jessfraz / boxstarter.ps1
Last active March 4, 2025 09:17
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <[email protected]>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@dishbreak
dishbreak / magic_jq_task.sh
Last active September 4, 2024 17:02
Easy way in Bash to check that a binary is installed.
#!/bin/bash
# Exit on the first command that returns a nonzero code.
set -e
# Function that checks if a given executable is on the path. If it isn't, prints an install message and exits.
# Usage: check_binary EXECUTABLE_NAME INSTALL_MESSAGE
check_binary() {
if ! which "$1" > /dev/null; then
# Using a subshell to redirect output to stderr. It's cleaner this way and will play nice with other redirects.
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 8, 2025 14:18
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@huytd
huytd / wordle.md
Last active April 1, 2025 00:28
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@link2xt
link2xt / ewma.py
Created September 3, 2024 21:52
Exponential rate limiter with a single variable
#!/usr/bin/env python3
"""Implementation of exponential rate limiter from <https://dotat.at/@/2024-09-02-ewma.html>,
but using a single variable `next-time` to store the state."""
import time
import math
class RateLimiter:
def __init__(self, window, limit):
self.next_time = 0.0