Skip to content

Instantly share code, notes, and snippets.

@marxangels
marxangels / express-hot-reload.js
Last active September 10, 2023 03:59
A simple module-level hot-reload for my express web application with less than 200 lines of code.
import fs from 'fs'
import vm from 'vm'
import path from 'path'
/*
* cli command
* node --experimental-vm-modules express-hot-reload.js
*/
const ModuleCache = new Map()
@marxangels
marxangels / pool.go
Created March 28, 2020 16:28
[Go] time.Timer + sync.Pool
package foo
import (
"sync"
"time"
)
var timerPool sync.Pool
func PoolTimerGet(d time.Duration) *time.Timer {
@marxangels
marxangels / ics-reset.ps1
Last active October 23, 2019 01:11
How to fix ICS (Windows Internet Connection Sharing) not working after reboot? Just reset ICS manually, or do it by PowerShell.
# Reset Windows Internet Connection Sharing by PowerShell.
# PowerShell.exe -ExecutionPolicy Bypass C:\Path\to\ics-reset.ps1
$module = New-Object -ComObject HNetCfg.HNetShare
$list = New-Object System.Collections.Generic.List[System.Object]