Skip to content

Instantly share code, notes, and snippets.

View eliheuer's full-sized avatar

Eli Heuer eliheuer

View GitHub Profile
@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
@pcwalton
pcwalton / smoothstep-replacement.inc.glsl
Created March 20, 2019 21:48
smoothstep-replacement.inc.glsl
float aastep(float edge0, float edge1, float x) {
float t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0) - 0.5;
return 1.14191 * t - 0.83570 * t * t * t;
}
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):
@thundernixon
thundernixon / stylus-gmail-enhance-readability.css
Last active December 25, 2021 02:08
Make GMail more readable with this CSS in the Chrome Extension *Stylus*
/* ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ */
/* Use with the Stylus Chrome extension */
/* Paste it into a Stylus style for URLs starting with https://mail.google.com */
/* (Probably won't work forever, but works as of November 2018) */
/* ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ */
/* =========================================================================== */
@thundernixon
thundernixon / drawbot-example-hex2rgb-call.py
Last active January 25, 2020 04:36
Use normal hex values in Drawbot
### Example of using the method in a script for Drawbot
# import the method from hexToRgb.py (have hexToRgb.py in the same folder as your script)
# alternatively, you can also just include the whole method in your code
from hex2rgb import hex2rgb
# have a hex color in mind (works with or without the # sign)
myHex = "#2F3137"
# use an asterisk to feed the tuple (R,G,B) result in place of any usual drawbot color value

Font "package manager"

I've been thinking about creating a font management service similar to traditional software package managers (e.g. Debian Aptitude, NPM, etc.)

The basic idea is this:

  1. There's a main repository of fonts that are free (as in free to distribute) that the working group hosts
  2. There's a small program that serves as the "manager", to be used or installed on client systems
  3. The "manager" can be configured to operate with multiple repositories
@terabyte
terabyte / amazon.md
Created December 6, 2017 02:27
Amazon's Build System

Prologue

I wrote this answer on stackexchange, here: https://stackoverflow.com/posts/12597919/

It was wrongly deleted for containing "proprietary information" years later. I think that's bullshit so I am posting it here. Come at me.

The Question

Amazon is a SOA system with 100s of services (or so says Amazon Chief Technology Officer Werner Vogels). How do they handle build and release?

@cmahns
cmahns / citibike.sh
Last active April 19, 2017 15:40
Quick, not optimized bash script to run in a cronjob at the end of the day. This will print the number of available bikes near a hard coded location and how many bike racks are available near New York's scenic Port Authority Bus Terminal.
#!/bin/bash
## Quick script to mention how many bikes are available near $EMPLOYER
## Will also show how many bike racks are available near PABT
## relies on curl and jq
## curl: https://curl.haxx.se/
## jq: https://stedolan.github.io/jq/
URL="https://feeds.citibikenyc.com/stations/stations.json"
JSON="/tmp/citibike.json"
@simoncozens
simoncozens / otvar-instance.py
Created September 27, 2016 10:04
OpenType Variation Instance Generator
#!/usr/bin/python
from fontTools.misc.py23 import *
from fontTools.ttLib import TTFont
import sys
import argparse
parser = argparse.ArgumentParser(description="OpenType Variation Instance Generator")
parser.add_argument('font', help="font file")
parser.add_argument('-a', '--all', action="store_true", help="Generate all instances")
parser.add_argument('-o', '--output', help="Output directory", default = ".")
@darkyen
darkyen / gist:120c46739985ebf3b39b
Created June 10, 2015 03:40
Ferengi Rules of Acquisition [Complete List*]
1 "Once you have their money, you never give it back." "The Nagus" (DS9 episode)
2 "The best deal is the one that makes the most profit." The 34th Rule (DS9 novel)
3 "Never spend more for an acquisition than you have to." "The Maquis, Part II" (DS9 episode)
4 "A woman wearing clothes is like a man in the kitchen." The Ferengi Rules of Acquisition (DS9 novel)
5 "Always exaggerate your estimates." Cold Fusion (SCE novel)
6 "Never let family stand in the way of opportunity." "The Nagus" (DS9 episode)
7 "Always keep your ears open." "In the Hands of the Prophets" (DS9 episode)
8 "Small print leads to large risk." The Ferengi Rules of Acquisition (DS9 novel)
9 "Instinct, plus opportunity, equals profit." "The Storyteller" (DS9 episode)
10 "Greed is eternal." "Prophet Motive" (VOY episode)