Skip to content

Instantly share code, notes, and snippets.

View andjc's full-sized avatar

Andj andjc

  • Melbourne, Australia
View GitHub Profile
@andjc
andjc / african_script_fonts.md
Created December 6, 2023 05:29
List of fonts supporting African scripts.

African Script fonts

Adlam

  • ADLaM Display – OFL 1.1; 1 file (Regular)
  • Ebrima – Commercial; 2 files (Regular, Bold)
  • Kigelia – Commercial; 6 files (Light, Light Italic, Regular, Italic, Bold, Bold Italic)
  • Noto Sans Adlam – OFL 1.1; 4 files (Regular, Medium, SemiBold, Bold); 1 variable font.
  • Noto Sans Adlam Unjoined – OFL 1.1; 4 files (Regular, Medium, SemiBold, Bold); 1 variable font.
@andjc
andjc / is_confusable.md
Last active October 25, 2024 02:46
Get skeleton for confusable characters

Exemplars for confusable characters (normalising confusable data)

Normally when preprocessing text, we want to normalise our data. Unicode Normalisation Forms KC and KD can be used for converting compatibility characters during normalisation. This will handle some confusable characters, but not all. The function below attempts to normalise confusable characters.

In is_confusable() we parse a string using icu.SpoofChecker, which is based on Unicode Technical Report #36 and Unicode Technical Standard #39.

UTS 39 defines two strings to be confusable if they map to the same skeleton.

@andjc
andjc / work-with-multiple-github-accounts.md
Created August 7, 2023 15:33 — forked from rahularity/work-with-multiple-github-accounts.md
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@andjc
andjc / ngraphs.py
Last active August 8, 2023 07:06
For a specific text (string) identify and count occurances of (character or grapheme based) ngraphs in text
from collections import Counter
import regex
class ngraphs:
"""Calculate ngraph occurrences for target string
Attributes
----------
text: str
A plain text string to be analysed. Specific to ngraph instance.
@andjc
andjc / to-ipa.py
Created June 11, 2023 12:04 — forked from trhura/to-ipa.py
script to convert burmese syllables to ipa symbols
#! /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:
@andjc
andjc / detect_tagged_pdf.py
Created May 21, 2023 06:28 — forked from joelhsmith/detect_tagged_pdf.py
Python script to check if a PDF has tags. Result is export of tagged content to console and searches it for traditional acrobat tags
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:
@andjc
andjc / gitzip.sh
Created March 23, 2023 11:46 — forked from LeonardoCardoso/gitzip.sh
Zip folder ignoring files listed on .gitignore
#...
function gitzip() {
git archive -o [email protected] HEAD
}
#... gitzip ZIPPED_FILE_NAME
@andjc
andjc / .bash_profile
Created March 23, 2023 11:44 — forked from signaltrace-dev/.bash_profile
Aliases for Git Bash - handy functions for common tasks
# 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
@andjc
andjc / gitzip.sh
Created March 23, 2023 11:44 — forked from dougalcampbell/gitzip.sh
gitzip -- create a zip file of a git project
#!/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"; }
@andjc
andjc / quarter.py
Created March 14, 2023 11:02 — forked from aodin/quarter.py
Python 3 datetime.date subclass
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)