Skip to content

Instantly share code, notes, and snippets.

kjd /
Last active August 30, 2022 23:27
Which TLDs are not in the Public Suffix List?
#!/usr/bin/env python3
import requests, idna
current_suffixes = [x for x in requests.get(PUBLIC_SUFFIX_URL).text.split('\n') if x and not x.startswith('//')]
current_tlds = [idna.decode(x) for x in requests.get(DELEGATED_TLDS_URL).text.split('\n') if x and not x.startswith('#')]
kjd /
Created June 16, 2017 16:49
ccTLD to flags with Emoji
def cctld_to_flag(domain):
for letter in domain:
print(chr(ord(letter)+127365), end='')
### Keybase proof
I hereby claim:
* I am kjd on github.
* I am kjd ( on keybase.
* I have a public key whose fingerprint is E6D9 BAAD 8BE6 9E14 F383 7E49 D9B1 54C1 4A6C 23DC
To claim this, I am signing this object:
#!/usr/bin/env python
# Base 58 function used by Flickr e.g. photo id 2360374815 becomes
def base58(i):
chars = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
o = ''
while (1):