Skip to content

Instantly share code, notes, and snippets.

View kessl's full-sized avatar
🦑

Daniel Kessl kessl

🦑
View GitHub Profile
title slug tags author created
Wireguardifying crappy work VPN
wireguardifying-crappy-work-vpn
devops
Daniel
2021-06-28 13:20:20 -0700

Wireguardifying crappy work VPN

@kessl
kessl / ceil.py
Created September 19, 2022 15:37
# simplest: round up using math.ceil
math.ceil(11 / 3)
# using integer division
result = 11 // 3
if result * 3 != 11: # or 11 % 3 != 0 or 11 % 3 > 0
result += 1
# smartass way 🙃 equivalent to the above
11 // 3 + (11 % 3 > 0)