Skip to content

Instantly share code, notes, and snippets.

Chris Simpkins chrissimpkins

Block or report user

Report or block chrissimpkins

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
chrissimpkins /
Last active Mar 5, 2020
Approach for removal of comments with syn crate
struct CommentRemove;
impl VisitMut for CommentRemove {
fn visit_attribute_mut(&mut self, node: &mut Attribute) {
// identify comments
if node.path.is_ident("doc") {
println!("{:?}", node.tokens);
println!("{:?}", node.path);
// can you "null" out the Attribute in some way so that the comments are removed when you transform back into Rust text source?
// or is there a different approach?
chrissimpkins /
Created Mar 3, 2020
rustc-guide references in rust-lang/rust repository

Output from rg "rustc-guide":

23:    "src/doc/rustc-guide",

chrissimpkins /
Last active Jan 30, 2020
Build Noto Nastaliq Urdu with fontmake
fontmake -g NotoNastaliqUrdu.glyphs -o otf ttf --mti-source NotoNastaliqUrdu.plist --no-production-names
chrissimpkins /
Created Jan 16, 2020 — forked from XVilka/
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
chrissimpkins /
Created Jan 14, 2020 — forked from kylehowells/
Extract the plain text from markdown, for plain text search.
import commonmark
with open('', 'r') as myfile:
text =
parser = commonmark.Parser()
ast = parser.parse(text)
# Returns the text from markdown, stripped of the markdown syntax itself
def ast2text(astNode):
chrissimpkins /
Created Jan 12, 2020 — forked from moyogo/
Check language CLDR locales supported by a font
Requires pyicu, fontTools
Denis Moyogo Jacquerye []
MIT License []
import sys
import icu

Keybase proof

I hereby claim:

  • I am chrissimpkins on github.
  • I am csimpkins ( on keybase.
  • I have a public key ASDA5NOeS_OGJGEyRFv4MHc6LYKMtHmvKznuaHzryrdBxQo

To claim this, I am signing this object:

chrissimpkins /
Last active Nov 25, 2019
Check coordinates in font glyphs vs. x and y Min + Max value definitions defined in the glyph header (glyf table)
#!/usr/bin/env python3
# ---------------------------------------------------------------------------
# Copyright 2019 Christopher Simpkins
# Apache License, v2.0
# Portions of this source file are derived from the
# ``
chrissimpkins /
Created Nov 7, 2019
Unicode hex value checks in cmap tables (fonts)
tt = TTFont(fontpath)
cmap = tt.getBestCmap()
# now the integers are keys in the cmap object and can be used to compare against hexadecimal values for presence in a font
test_list = (hex1, hex2, hex3,...)
# how to split hex ranges to individual hex codes
# e.g., 0x0020-0x0028
for x in range(0x0020,0x0028):
chrissimpkins / Makefile
Created Sep 20, 2019
Example Makefile for font projects
View Makefile
# define project name
# define path to the font build directory for tests
python3 -m venv ~/venv/$(PROJECT)
# can't activate and deactivate from Makefile
# because it runs new subshells for each
You can’t perform that action at this time.