Skip to content

Instantly share code, notes, and snippets.

# https://github.com/psf/requests/issues/2359#issuecomment-552736992
import requests
import cchardet
class ForceCchardet:
@property
def apparent_encoding(obj):
return cchardet.detect(obj.content)['encoding']
requests.Response.apparent_encoding = ForceCchardet.apparent_encoding
@sertraline
sertraline / tcvn3.py
Created November 7, 2020 03:51
TCVN3 to UTF-8
# TCVN3 to UTF-8
UNICODETAB = [
"À", "Á", "Â", "Ã", "È", "É", "Ê", "Ì", "Í", "Ò",
"Ó", "Ô", "Õ", "Ù", "Ú", "Ý", "à", "á", "â", "ã",
"è", "é", "ê", "ì", "í", "ò", "ó", "ô", "õ", "ù",
"ú", "ý", "Ă", "ă", "Đ", "đ", "Ĩ", "ĩ", "Ũ", "ũ",
"Ơ", "ơ", "Ư", "ư", "Ạ", "ạ", "Ả", "ả", "Ấ", "ấ",
"Ầ", "ầ", "Ẩ", "ẩ", "Ẫ", "ẫ", "Ậ", "ậ", "Ắ", "ắ",
"Ằ", "ằ", "Ẳ", "ẳ", "Ẵ", "ẵ", "Ặ", "ặ", "Ẹ", "ẹ",
"Ẻ", "ẻ", "Ẽ", "ẽ", "Ế", "ế", "Ề", "ề", "Ể", "ể",
@sertraline
sertraline / print_odd_even.asm
Created July 6, 2019 16:28
NASM: find odd and even characters in the string, save and print them
; NASM i386
; nasm -f elf print_odd_even.asm
; ld -m elf_i386 print_odd_even.o -o print_odd_even
;
; EXAMPLE
; bash# ./print_odd_even
; Enter the string: The quick brown fox jumps over the lazy dog
; Odd:
; Teqikbonfxjmsoe h aydg
; Even: