Skip to content

Instantly share code, notes, and snippets.

View eliheuer's full-sized avatar

Eli Heuer eliheuer

View GitHub Profile
# modified from https://gist.github.com/simoncozens/699aa96e98321e19a0a2cccbce994c47
# python3 activity.py DDMMYY DDMMYY
import sys
import requests
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta, FR
from datetime import datetime
import os
@eliheuer
eliheuer / vf-normalize.py
Created August 31, 2023 18:18
vf-normalize.py
def remap(value, inputMin, inputMax, outputMin, outputMax):
inputSpan = inputMax - inputMin # FIND INPUT RANGE SPAN
outputSpan = outputMax - outputMin # FIND OUTPUT RANGE SPAN
valueScaled = float(value - inputMin) / float(inputSpan)
return outputMin + (valueScaled * outputSpan)
test01 = remap(0, -100, 100, 20, 250)
print(test01)
MINI-M1 🌎福 ~/Google-Fonts/gf-fork-packager
10072 🔅 : gftools packager "Chilanka" fonts/ -p [~]
Font Family "Chilanka" is on Google Fonts under "ofl".
Using upstream.yaml from google/fonts for Chilanka.
Do you want to edit the current upstream configuration?
Your options y=yes,[n]=no:y
temp file name is /var/folders/ht/8b6qb9pj7csc3pn8bgwwx3j80000gn/T/upstreamodbvjvef.yaml
Creating package with
----- upstream configuration (no comments, normalized) -----
name: Chilanka
@eliheuer
eliheuer / GF-New-M2-mac-setup-2023.md
Last active August 12, 2023 03:04
GF-New-M2-mac-setup-2023

GF New M2 mac setup 2023

is gftools qa depricated?

@eliheuer
eliheuer / metrics_compatible.py
Created August 10, 2023 16:05 — forked from m4rc1e/metrics_compatible.py
Check whether two fonts are metrics compatible by testing on random strings
import random
import string
import uharfbuzz as hb
import sys
from fontTools.ttLib import TTFont
def generate_random_string(fp):
f = TTFont(fp)
cmap = f.getBestCmap()
length = random.randint(3, 100)
@eliheuer
eliheuer / gf-glyphset-check.py
Last active December 30, 2022 06:46
This script iterates through the full Google Fonts catalog and checks each font to see how many codepoints from the GF_Latin_African.txt glyphset are included. Can be modified to work with other glyphsets as needed.
# To use this script, place it in a directory with a clone of the
# Google Fonts "fonts" directory and a text file from GF-Glyphssets.
# .
# ├── GF_Latin_African.txt
# ├── fonts
# └── gf-glyphset-check.py
#
# See links below:
#
# https://github.com/google/fonts
@eliheuer
eliheuer / GF-Proof-extra-text-HB.html
Created October 20, 2022 02:13
GF proof extra text HB
<hr>
<div dir="auto" class="Solitreo-Regular" style="font-size: 14pt">שבתי, יוסף, מיכאל, חיים, ישראל איס אקי, מיס אולטימאס ב'ולונטאד'יס, קי ב'וס ריקומינדו די אינג'יר, סין מאנקאר נאד'ה. אי קי ב'וס אגו, אין יינה קונסיינסייה, אי אין סאלוד', איספירו קי מי אונוראריש, דיספואיס די מי מואירטי אל טאנטו קי מי אונוראטיש אין ב'יד'ה פאס אי אונייון! י</span>
<hr>
<div dir="auto" class="Solitreo-Regular" style="font-size: 14pt">לא יהא אדם נתון להתערבות שרירותית בחייו הפרטיים, במשפחתו, במעונו, בחליפת מכתבים שלו ולא לפגיעה בכבודו או בשמו הפוב כל אדם זכאי להגנת החוק בפני התערבות או פגיעה באלה כל אדם זכאי לחירות המחשבה, המצפון והדת; חירות זו כוללת את הזכות להמיר את דתו או את אמונתו ולתת בטוי לדתו או לאמונתו, לבדו או כציבור, ברשות היחיד או ברשות הרבים, דרך הוראה, נוהג, פולחן ושמירת מצוות</span>
<hr>
<div dir="auto" class="Solitreo-Regular" style="font-size: 14pt">קאדח בנאדם אי בנאדם נאסי פוררו אי איגואו אין דינייידאד אין דיריג׳וס טודוס סון בעלה ראזון אי קונסיינסיה אי דיב׳ין קומפורטארסין לוס או
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eliheuer
eliheuer / gh-timesheet.py
Created March 18, 2022 00:23 — forked from simoncozens/gh-timesheet.py
gh-timesheet.py
import requests
from dateutil.relativedelta import relativedelta, FR
from datetime import datetime
lastweek = datetime.utcnow().replace(hour=0,microsecond=0) + relativedelta(weekday=FR(-1))
headers = {"Authorization": "bearer "+GITHUB_TOKEN}
def run_query(query):
request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers)
@eliheuer
eliheuer / bezier_drawbot.py
Created February 8, 2022 21:59 — forked from justvanrossum/bezier_drawbot.py
Bezier demo for DrawBot
def lerp(v1, v2, t):
return v1 + t * (v2 - v1)
def lerpPoint(p1, p2, t):
return lerp(p1[0], p2[0], t), lerp(p1[1], p2[1], t)
def circle(p, r):
x, y = p
d = r * 2
oval(x - r, y - r, d, d)