This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Script to create an image of a glyph in the current layer. | |
Instructions: | |
- Use within the Drawbot plugin of GlyphsApp. | |
- Get this plugin via Window > Plugin Manager, then search for "Drawbot" and install it. | |
- Then, go to File > New Drawbot, and paste in this code and run it. | |
- You may need to restart glyphs for the Plugin to work. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let widget = await createWidget() | |
if (config.runsInWidget) { | |
Script.setWidget(widget) | |
} else { | |
widget.presentMedium() | |
} | |
Script.complete() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fontTools.ttLib import TTFont | |
from fontTools.ttLib.tables._g_l_y_f import Glyph | |
f = TTFont('Font.ttf') | |
assert 'glyf' in f and 'gvar' not in f, 'Must be a static font with a `glyf` table.' | |
for name in f['glyf'].keys(): | |
if not f['glyf'][name].isComposite(): | |
f['glyf'][name] = Glyph() | |
f.save('Font-Regular-Blank.ttf') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See this Twitter thread: | |
# https://twitter.com/MauriceMeilleur/status/1488347208709718021 | |
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) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get balanced dash-strokearray and dash-strokeoffset properties for a path of a given length. | |
* @param length The length of the path. | |
* @param strokeWidth The shape's stroke-width property. | |
* @param style The stroke's style: "dashed" or "dotted" (default "dashed"). | |
* @param snap An interval for dashes (e.g. 4 will produce arrays with 4, 8, 16, etc dashes). | |
*/ | |
export function getPerfectDashProps( | |
length: number, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Make a cool reflected alphabet pattern. | |
Inspired by Klaus Burkhardt and Reinhard Döhl, Rot 40: | |
Poem Structures In the Looking Glass, Edition Rot, Stuttgart, 1969. | |
https://twitter.com/Lett_Arc/status/1375252819620466688 | |
""" | |
s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
NewerOlder