Skip to content

Instantly share code, notes, and snippets.

View typoman's full-sized avatar
:electron:
Never stop learning!

Bahman Eslami typoman

:electron:
Never stop learning!
View GitHub Profile
@typemytype
typemytype / glyphLineController.py
Last active August 28, 2023 11:13
show multiple glyphs in a glyph editor RF4
# this scripts add a input field at the top of your glyph window
# the input text is converted to a list of glyphs objects
# and set into the glyph editor
# jump around with `esc` and select to edit by hitting a glyph
from mojo.UI import GlyphSequenceEditText
from mojo.subscriber import Subscriber, registerGlyphEditorSubscriber
class GlyphLineController(Subscriber):
@moaminsharifi
moaminsharifi / spotify_ad_blocker.md
Created October 16, 2020 05:38
#spotify ad blocker /etc/hosts

#spotify ad blocker

edit /etc/hosts on linux

c:\windows\system32\drivers\etc\hosts

127.0.0.1 media-match.com
127.0.0.1 adclick.g.doublecklick.net
127.0.0.1 www.googleadservices.com
127.0.0.1 open.spotify.com
127.0.0.1 pagead2.googlesyndication.com
@MatthijsKamstra
MatthijsKamstra / adobe-illustrator-cs2-osx.xml
Last active October 21, 2022 09:44
Inkscape Illustrator shortcuts for OSX
<?xml version="1.0"?>
<keys name="Adobe Illustrator">
<!--
This file contains a profile of keyboard shortcuts for Inkscape
in the style of Adobe Illustrator.
See default.xml for more information.
-->
@eviltester
eviltester / gist:11093f0e4c501a41990e227393184eda
Last active April 24, 2024 11:35
uncheck twitter interests
var timer=100;document.querySelectorAll("div > input[type='checkbox']:checked").forEach((interest) => {setTimeout(function(){interest.click()},timer);timer+=2000;});
@chrissimpkins
chrissimpkins / Makefile
Created September 20, 2019 18:34
Example Makefile for font projects
# define project name
PROJECT=replaceme-with-project-name
# define path to the font build directory for tests
FONT_DIR="/path/to/font/file/directory"
venv:
python3 -m venv ~/venv/$(PROJECT)
# can't activate and deactivate from Makefile
# because it runs new subshells for each
@stratosgear
stratosgear / paypal_experience.md
Last active July 29, 2019 15:26
Ask HN: Is this Paypal experience customary?

Here is a succinct timeline of the events.

  • I received a Paypal notification that 600 USD were deposited on my account.
  • I was not expecting any money, so I logged in to see what this is about.
  • Apparently someone paid me for an item they bought on Ebay.
  • The information contained on my Paypal account about the transaction, did NOT contain any information on what this is about.
  • I am NOT an Ebay seller, so I have nothing else to follow this up.
  • My first thought (apart from quickly spending the money) was that some poor soul after thinking that they have paid for an item they would wait for ever for an item they thought they purchased, only to never receive it.
  • So I spent some considerable amount of time trying to locate the seller from their name only (did not have an email) by googling around, to clarify the issue
  • As it was getting late, I left the issue to continue the next day.
@gxfxyz
gxfxyz / pipenv_virtualenv.py
Created November 15, 2018 22:19
Sublime Text 3 Pipenv virtualenv helper
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Sublime Text 3 Pipenv virtualenv helper.
1. Automatically find and set Pipenv virtualenv for each opened Python file.
- It uses `pipenv --venv` command to find the virtualenv.
- It will add a 'virtualenv' setting, which is the full path to the virtualenv,
@adrientetar
adrientetar / ufoLib.md
Last active December 26, 2019 14:13
Technical note on the design of a new UFO library.

Thoughts on fontTools.ufoLib

w.r.t. my experience with defcon and ufoLib. Some of the functionality I discuss (notifications, etc.) definitely shouldn't go into fontTools however we ought to make fontTools.ufoLib "compatible" with these extra features. I'm sure we can do simple and versatile.

IMO fontTools.ufoLib should basically be written from scratch (with copy-pasting here and there) since ufoLib/defcon have significant bloat and apparently we want to use lxml.

General comments

Avoid the check-and-use pattern

@adrientetar
adrientetar / prof.md
Last active December 26, 2019 14:14

Here are my findings after profiling the loading of Roboto-Regular.ufo.

Setting Lib objects into the Glyph-s is expensive (10%)

  • the Lib.update(...) call is expensive (4.9%), mainly because of postNotification and _set_dirty
  • creating Lib is expensive, mainly because of beginSelfNotificationObservation (3.4%), _get_dispatcher is a large contributor of the time spent (2.5%) as it does a chain of calls from getfont to getlayerset to getlayer
  • _set_dirty (0.5%)

Solution