Skip to content

Instantly share code, notes, and snippets.

View Saliva520319's full-sized avatar

ChuFengze Saliva520319

View GitHub Profile
@Integralist
Integralist / Python URL Validation.py
Last active September 22, 2023 17:42
[Python URL Validation] #python #urls #validation
import re
ip_middle_octet = u"(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5]))"
ip_last_octet = u"(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))"
regex = re.compile(
u"^"
# protocol identifier
u"(?:(?:https?|ftp)://)"
# user:pass authentication
@arun-gupta
arun-gupta / readme.adoc
Last active February 19, 2019 03:02
Service Mesh and Open Tracing
@hrldcpr
hrldcpr / tree.md
Last active January 24, 2026 21:18
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@dahlia
dahlia / lisp.rb
Created September 2, 2010 07:52
30 minutes Lisp in Ruby
# 30 minutes Lisp in Ruby
# Hong Minhee <http://dahlia.kr/>
#
# This Lisp implementation does not provide a s-expression reader.
# Instead, it uses Ruby syntax like following code:
#
# [:def, :factorial,
# [:lambda, [:n],
# [:if, [:"=", :n, 1],
# 1,