Skip to content

Instantly share code, notes, and snippets.

View chaleaoch's full-sized avatar
😃
Golang

Zhichao,Feng chaleaoch

😃
Golang
View GitHub Profile
@chaleaoch
chaleaoch / ipint.go
Created November 30, 2022 09:11 — forked from ammario/ipint.go
Golang IP <-> int conversion
func ip2int(ip net.IP) uint32 {
if len(ip) == 16 {
panic("no sane way to convert ipv6 into uint32")
}
return binary.BigEndian.Uint32(ip)
}
func int2ip(nn uint32) net.IP {
ip := make(net.IP, 4)
binary.BigEndian.PutUint32(ip, nn)
@chaleaoch
chaleaoch / flask skeleton folder tree
Created March 28, 2022 07:28 — forked from efazati/Py Flask Skeleton
flask folders and files structure
.
├── deploy.py
├── project
│   ├── application.py
│   ├── apps
│   │   ├── articles
│   │   │   ├── forms.py
│   │   │   ├── __init__.py
│   │   │   ├── models.py
│   │   │   └── views.py