Skip to content

Instantly share code, notes, and snippets.

View rmlandvreugd's full-sized avatar

R. Mathieu Landvreugd rmlandvreugd

View GitHub Profile
@tarruda
tarruda / micro_events.py
Last active March 24, 2025 14:06
Micro event loop library to teach the basic concepts of python coroutines and how event loop libraries might be implemented
"""
A micro event loop library implementation from scratch.
This library provides a minimal but feature-complete asynchronous event loop
implementation for educational purposes. It demonstrates the core concepts of
asynchronous programming including:
- Task scheduling and management
- I/O multiplexing with non-blocking sockets
- Timeouts and sleep functionality
@zadjii-msft
zadjii-msft / README.md
Last active March 8, 2025 13:14
Warp Workflows for the Windows Terminal

Add all the Warp Workflows to Windows Terminal

With a combination of features all available in Windows Terminal 1.22, you can now add all your favorite Warp Workflows directly to the Windows Terminal.

image image

This works by adding the workflows to your settings via a "settings fragment". You can then open a menu with all these workflows with the openSuggestions action.

@mitchellh
mitchellh / merge_vs_rebase_vs_squash.md
Last active March 18, 2025 21:32
Merge vs. Rebase vs. Squash

I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.

I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:

@AppleBoiy
AppleBoiy / alias_eza.md
Last active March 31, 2025 06:53
eza-ls

Alias eza for ls command

Put to shell configure file

first install eza by homebrew

brew install eza

Basic setup

@craigloewen-msft
craigloewen-msft / autoMemoryReclaim.sh
Created September 18, 2023 20:01
Auto memory reclaim shell script
#!/bin/bash
# Put under /etc/autoMemoryReclaim.sh
# set variables at the top
low_cpu_usage=50 # Note: We work with integer percentages (e.g., 50%)
idle_time=2 # Minutes
cached_memory_limit=1000 # MB
percent_memory_to_reclaim=5 # Percentage as an integer
wait_period=3
@oleksis
oleksis / Fedora-WSL2.md
Last active March 21, 2024 18:12
Fedora 38 on WSL2 using PowerShell

Fedora 38 x86_64 on WSL2 using PowerShell

Download and import the Fedora base container (Powershell)

$DownloadURL = "https://kojipkgs.fedoraproject.org//packages/Fedora-Container-Base/38/20230801.0/images/Fedora-Container-Base-38-20230801.0.x86_64.tar.xz"
$OutputFile = "$env:USERPROFILE\Downloads\Fedora-Container-Base-38-20230801.0.x86_64.tar.xz"
Invoke-WebRequest -Uri $DownloadURL -OutFile $OutputFile

# Extract the downloaded tarball and move the root file system to the appropriate location
# winget install --id 7zip.7zip
@oleksis
oleksis / Dockerfile
Last active July 18, 2024 07:16
Rancher Desktop, K3s and Traefik ingress controller
FROM nginx:alpine
COPY . /usr/share/nginx/html
@oleksis
oleksis / wsl2- Linux-6.3.md
Last active April 7, 2023 18:43
WSL2 and Custom Linux/x86 Kernel >= v6.3-rc4

WSL2 and Custom Linux/x86 Kernel v6.3-rc4

Follow the Custom Linux/x86 Kernel Configuration for compile the Linux kernel source >= v6.3-rc4 getting this errors:

wsl -d Ubuntu Output:

Catastrophic failure
Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/E_UNEXPECTED
Catastrophic failure
@nkhitrov
nkhitrov / structlog_fastapi.py
Created March 16, 2023 00:04
Structlog FastAPI example
"""
Structlog example configuration with FastAPI.
Features:
- async bound logger
- contextvars to log request-id and other meta data
- custom format for default logging loggers and structlog loggers
"""
import asyncio
import logging
@oleksis
oleksis / v1.0.0_wsl2_wslg_display_x0.md
Last active September 8, 2024 09:08
X11 display socket in WSLg

Update to WSL2 v1.0.0

➜ wsl --shutdown
➜ wsl --update --web-download
➜ wsl --version
WSL version: 1.0.0.0
Kernel version: 5.15.74.2
WSLg version: 1.0.47
MSRDC version: 1.2.3575