Browser support MDN
- ✅ Chrome 64 & Edge 79
- ✅ Safari 11.1
- ✅ Firefox 78
- ✅ nodejs: 10.0
- ✅ babel
#! /usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
def get_ipa (syllable): | |
ipa = '' | |
ipa += get_cons_ipa(syllable) | |
ipa += get_medial_ipa(syllable) | |
ipa += get_vowel_ipa (syllable) | |
if u"\u028A" in ipa: |
from pdfminer3.pdfinterp import PDFResourceManager, PDFPageInterpreter | |
from pdfminer3.pdfdevice import TagExtractor | |
from pdfminer3.pdfpage import PDFPage | |
from io import BytesIO | |
def convert_pdf(path, password=''): | |
rsrcmgr = PDFResourceManager() | |
retstr = BytesIO() | |
try: |
#... | |
function gitzip() { | |
git archive -o $@.zip HEAD | |
} | |
#... gitzip ZIPPED_FILE_NAME |
# generated by Git for Windows | |
test -f ~/.profile && . ~/.profile | |
test -f ~/.bashrc && . ~/.bashrc | |
_gitzip(){ | |
CURRDATE=`date +%Y%m%d` | |
NAME=${PWD##*/} | |
ARG=$1 | |
LAST_COMMIT=$2 |
#!/bin/bash | |
## | |
## I usually put this in my .bashrc | |
## | |
## When in a git project dir, run 'gitzip foo' to get a 'foo.zip' in the parent | |
## directory. | |
gitzip() { git archive HEAD --format=zip --prefix="$*/" > ../"$*.zip"; } |
import copy | |
import datetime | |
import pickle | |
# Each quarter corresponds to the following month and day combinations: | |
_q1 = (3, 31) | |
_q2 = (6, 30) | |
_q3 = (9, 30) | |
_q4 = (12, 31) |
import icu | |
thkey = icu.Collator.createInstance(icu.Locale('th_TH')).getSortKey | |
words = 'ไก่ ไข่ ก ฮา'.split() | |
print(sorted(words, key=thkey)) # ['ก', 'ไก่', 'ไข่', 'ฮา'] |
from icu import Locale, UnicodeString | |
# loc = Locale.createCanonical("haw_US") | |
loc = Locale("haw_US") | |
s1 = "ʻōlelo hawaiʻi" | |
s2 = "oude ijssel " | |
print(UnicodeString(s1).toTitle(loc)) | |
print(UnicodeString(s2).toTitle(Locale("nl_NL")).trim()) |
# -*- coding: utf-8 -*- | |
"""Example Google style docstrings. | |
This module demonstrates documentation as specified by the `Google Python | |
Style Guide`_. Docstrings may extend over multiple lines. Sections are created | |
with a section header and a colon followed by a block of indented text. | |
Example: | |
Examples can be given using either the ``Example`` or ``Examples`` | |
sections. Sections support any reStructuredText formatting, including |