Skip to content

Instantly share code, notes, and snippets.

View alsritter's full-sized avatar
😺

ALSRitter alsritter

😺
View GitHub Profile
@HydrangeaPurple
HydrangeaPurple / Debounced.ts
Last active September 6, 2021 13:14
Typescript 使用函数防抖和节流
/**
* 函数防抖包装函数
* @author
* @export
* @class Debounced
*/
export class Debounced {
/**
* @param func 需要包装的函数
* @param delay 延迟时间,单位ms
@afdalwahyu
afdalwahyu / http_proxy.go
Last active June 20, 2024 12:25
golang http proxy server CONNECT method
package main
import (
"bufio"
"encoding/base64"
"flag"
"io"
"io/ioutil"
"log"
"net"
@chmike
chmike / checkDomain.go
Last active August 20, 2024 02:29
Check domain name validity in Go
// Please use the package https://github.com/chmike/domain as is it maintained up to date with tests.
// checkDomain returns an error if the domain name is not valid.
// See https://tools.ietf.org/html/rfc1034#section-3.5 and
// https://tools.ietf.org/html/rfc1123#section-2.
func checkDomain(name string) error {
switch {
case len(name) == 0:
return nil // an empty domain name will result in a cookie without a domain restriction
case len(name) > 255: