Skip to content

Instantly share code, notes, and snippets.

View fredyfx's full-sized avatar
💭
With all the power 2.0!

Fredy R. Guibert フレディ fredyfx

💭
With all the power 2.0!
View GitHub Profile
@fredyfx
fredyfx / MockElement.ts
Created July 16, 2020 23:06 — forked from jdhenckel/MockElement.ts
Mock DOM Document and Element in TypeScript for Unit testing in Headless environment.
/*
This can be used in unit tests to simulate a DOM document.
I have implemented the bare minimum. Feel free to add more, or to change my implementation.
Sample Usage:
import 'jasmine';
import { MockElement } from './support/mock-element';
@fredyfx
fredyfx / Restart-WSL-Network.ps1
Last active March 22, 2026 11:38
Basically I got tired of restarting manually the Network in order to have my Linux Distros running properly under Windows 11 as WSL. I think I'm not the only one with the same situation, so, here is the script, enjoy!
# ==============================================================================
# Restart-WSL-Network.ps1
# Restarts the Hyper-V virtual network adapter used by WSL2.
# Fixes: DNS resolution failures, "Temporary failure in name resolution",
# and general network connectivity issues inside WSL2.
#
# Usage:
# Right-click > "Run with PowerShell" (as Administrator)
# -- or --
# PowerShell (Admin): .\Restart-WSL-Network.ps1