Skip to content

Instantly share code, notes, and snippets.

agyeiarcher

Block or report user

Report or block agyeiarcher

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@agyeiarcher
agyeiarcher / UpdateCurrentGlyphView.py
Last active Oct 21, 2019
A simple script to update the current view for all current glyph windows to the one in the current glyph window, for easy switching between master glyphs.
View UpdateCurrentGlyphView.py
from mojo.UI import *
f=CurrentFont()
g=FindGlyph(f)
for k in AllFonts():
OpenGlyphWindow(k[g.name])
View monochromemondrian.py
canvas=500
divider=10
# made in drawbot - drawbot.com #
### this is a 'grid builder' that does the math separates the grid into random integers that add up to fill the entire thing. The variance in randomness can be controlled with the multiplier on the variance variable. we will use two arrays from this function, one to build rows, and the other to build columns. I based it off code found here: http://sunny.today/generate-random-integers-with-fixed-sum/ ###
def generate_random_integers(_sum, n):
View stripedtext.py
size(500,500)
txt="how \n to \n deal?"
path = BezierPath()
path.text((txt), font="Helvetica", fontSize=150, offset=(2, 380))
NLINES=100
def makelines(amt):
@agyeiarcher
agyeiarcher / xlrd-connect.py
Created Mar 16, 2018
xlrd: Connect to a Database
View xlrd-connect.py
from xlrd import open_workbook
wb = open_workbook('simple.xls')
for s in wb.sheets():
print 'Sheet:',s.name
for row in range(s.nrows):
values = []
for col in range(s.ncols):
values.append(s.cell(row,col).value)
print ','.join(values)
print
View TwoBlobs.py
from random import seed
from fontTools.pens.basePen import BasePen
rad = width()/4
nFrames=40
class BezierPathPen(BasePen):
"""FontTools pen -> BezierPath adapter."""
View rotatingsquares.py
BG = 1500
NSQUARES = 50
SQUARESIZE = 2000
NFRAMES = 96
TOTALROTATION=15
You can’t perform that action at this time.