Skip to content

Instantly share code, notes, and snippets.

View staugur's full-sized avatar
:octocat:
Sorry, thank you!

Hiroshi.tao staugur

:octocat:
Sorry, thank you!
View GitHub Profile
@staugur
staugur / Python URL Validation.py
Created September 3, 2019 08:24 — forked from Integralist/Python URL Validation.py
[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
@staugur
staugur / pac.js
Last active May 13, 2019 06:06 — forked from hipi/pac.js
PAC
var V2Ray = "PROXY 127.0.0.1:7071; DIRECT;";
var domains = [
"graphql.cn",
"gitter.im",
"amazonaws.com",
//"raw.githubusercontent.com",
//"githubusercontent.com",
//"github.io",
//"github.com",
"gist.github.com",
@staugur
staugur / beautiful_idiomatic_python.md
Created November 10, 2016 08:56 — forked from JeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]: