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
Show hidden characters
{ | |
"cmd": ["robofont", "-p", "$file"], | |
"file_regex": "^[ ]File \"(...?)\", line ([0-9]*)", | |
"selector": "source.python", | |
} |
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 mojo.UI import exportPreferences | |
import os.path | |
homeDir = os.path.expanduser("~") | |
exportPreferences("%s/Library/Mobile Documents/com~apple~CloudDocs/Preferences/Robofont/settings" %homeDir) |
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
#!/bin/bash | |
# Use this if you want to make a copy of your images and viodes with | |
# siginficant reduced size. This bash script duplicates the folder structure | |
# of all the sub folders underneath the current folder, and puts images and | |
# videos there. It also redcues the size of images and creates screenshots of | |
# videos instead of copying the resized video. Run it inside the folder that | |
# contains all your images, it will create another folder next to it and put | |
# the images and videos with reduced size there. |
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 mojo.events import addObserver, removeObserver | |
from vanilla import Window | |
class RoboFontDefconExample(): | |
def __init__(self): | |
self.w = Window((300, 120), "Debuggin window") | |
self.fonts = {} | |
for f in AllFonts(): | |
self._addFont(f) |
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 time | |
def timeit(method): | |
def timed(*args, **kw): | |
ts = time.time() | |
result = method(*args, **kw) | |
te = time.time() | |
if 'log_time' in kw: | |
name = kw.get('log_name', method.__name__.upper()) | |
kw['log_time'][name] = int((te - ts) * 1000) | |
else: |
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 defconAppKit.windows.baseWindow import BaseWindowController | |
from vanilla import FloatingWindow | |
from mojo.events import addObserver, removeObserver | |
from mojo.UI import SetCurrentGlyphByName | |
""" | |
RoboFont Helper | |
Type: Start up | |
Purpose: After it's run, if you double click on a component it will jump to its base glyph. | |
""" |
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
""" | |
RoboFont Script | |
- Type: Composite/Margins | |
- Purpose: Updates composites (a glyph which **only** has components e.g accented | |
letters) margins based on the base letter margins. | |
- Specifications: | |
- Determines the base letter according to (in order): unciode, | |
anchor names, glyph surface area (the darkest shape is the letter), | |
glyph width (if it's zero then it's accent). | |
- If the base letter is shifted in the composte (mostly by accident), it |
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
#!/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, |
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 AppKit | |
from vanilla import * | |
myHotKeys = {'⌘s', '⇧⌘s', '⌘q', '⇧⌘q'} | |
MODIFIER_INT_TO_STR = { | |
1048840: '⌘', | |
262401: '⌃', | |
524576: '⌥', | |
131330: '⇧', |
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 re | |
from collections import namedtuple | |
Token = namedtuple('Token', ['type', 'value', 'line', 'column']) | |
class Lexer(object): | |
_KEYWORDS = { | |
'if': 'IF_CONDITION', | |
'while': 'WHILE_LOOP', |
OlderNewer