Skip to content

Instantly share code, notes, and snippets.

View phayes's full-sized avatar
⌨️

Patrick Hayes phayes

⌨️
View GitHub Profile
switch pub := cert.PublicKey.(type) {
case *rsa.PublicKey:
fmt.Println(pub.N)
case default:
fmt.Println("Error, not an RSA public key")
}
@phayes
phayes / lang.json
Created March 24, 2022 15:36
Language Codes
{
"ab": {
"name": "Abkhaz",
"nativeName": "аҧсуа"
},
"aa": {
"name": "Afar",
"nativeName": "Afaraf"
},
"af": {
<?php
$url = "BCBT_Dec_2021.csv";
$csv = file_get_contents($url);
$csv = explode("\n", $csv);
$csv = array_filter($csv, "strlen");
$csv = array_map('str_getcsv', $csv);
$keys = array_shift($csv);
foreach ($csv as $i=>$row) {
@phayes
phayes / alphabets_and_scripts.json
Last active May 17, 2024 18:33
A JSON list of common alphabets and scripts and some of their properties
{
"Latn": {
"iso_code": "Latn",
"iso_number": 215,
"name": "Latin",
"unicode_ranges": ["U+0000–U+007F", "U+0080–U+00FF", "U+0100–U+017F", "U+0180–U+024F", "U+1E00–U+1EFF", "U+2C60–U+2C7F", "U+A720–U+A7FF"],
"languages": ["en", "fr", "de", "es", "pt", "it", "nl", "pl", "sv", "da", "no", "fi", "hu", "ro", "cs", "sk", "hr", "bs", "sl", "is"],
"direction": "ltr",
"casing": true,
"family": "Latin",