Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
#
# This script prepares fonts for use for embedded software. It minimizes them
# (to reduce size and increase performance), encodes them into C files (needed
# by devices without file systems), and prints debug info.
#
# When minimizing, it subsets the glyphs (to a latin set as-is here) and strips
# out layout features. It provides options for whether to keep kerning and in
# which format.
#
@chrissimpkins
chrissimpkins / mastodon_v4.1.0-maxchar-5000.patch
Created October 14, 2023 00:35
Increase Mastodon v4.1.0 max post character count to 5000
diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js
index e641d59f4..9b6f84fa1 100644
--- a/app/javascript/mastodon/features/compose/components/compose_form.js
+++ b/app/javascript/mastodon/features/compose/components/compose_form.js
@@ -90,7 +90,7 @@ class ComposeForm extends ImmutablePureComponent {
const fulltext = this.getFulltextForCharacterCounting();
const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0;
- return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (isOnlyWhitespace && !anyMedia));
+ return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 5000 || (isOnlyWhitespace && !anyMedia));
@chrissimpkins
chrissimpkins / linespace.sh
Last active November 14, 2023 06:36
linespace.sh
#!/bin/sh
# //////////////////////////////////////////////////////////////////////
#
# linespace.sh
# A shell script that modifies all .otf and .ttf fonts in the
# working directory to $PERCENT_UPM% UPM line spacing
# Copyright 2018 Christopher Simpkins
# MIT License
#
@chrissimpkins
chrissimpkins / hack-linux-installer.sh
Last active November 6, 2023 13:04
Hack typeface installer for Linux
#!/bin/sh
# /////////////////////////////////////////////////////////////////
#
# hack-linux-installer.sh
# A shell script that installs the Hack fonts from repository
# releases by release version number
#
# Copyright 2018 Christopher Simpkins
# MIT License
@chrissimpkins
chrissimpkins / mastodon_v4.2.1-maxchar-5000.patch
Created October 14, 2023 00:38
Increase Mastodon 4.2.1 max post character count to 5000. Note that the compose_form.js file path in <v4.2.0 releases changed to compose_form.jsx
diff --git a/app/javascript/mastodon/features/compose/components/compose_form.jsx b/app/javascript/mastodon/features/compose/components/compose_form.jsx
index 9222b2dc8..962310a28 100644
--- a/app/javascript/mastodon/features/compose/components/compose_form.jsx
+++ b/app/javascript/mastodon/features/compose/components/compose_form.jsx
@@ -100,7 +100,7 @@ class ComposeForm extends ImmutablePureComponent {
const fulltext = this.getFulltextForCharacterCounting();
const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0;
- return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (isOnlyWhitespace && !anyMedia));
+ return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 5000 || (isOnlyWhitespace && !anyMedia));
@chrissimpkins
chrissimpkins / mastodon_v4.0.2-maxchar-5000.patch
Created December 22, 2022 03:23
Increase Mastodon 4.0.2 max post character count to 5000
diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js
index 6a65f44da..b1e364451 100644
--- a/app/javascript/mastodon/features/compose/components/compose_form.js
+++ b/app/javascript/mastodon/features/compose/components/compose_form.js
@@ -90,7 +90,7 @@ class ComposeForm extends ImmutablePureComponent {
const fulltext = this.getFulltextForCharacterCounting();
const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0;
- return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (isOnlyWhitespace && !anyMedia));
+ return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 5000 || (isOnlyWhitespace && !anyMedia));
@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
@chrissimpkins
chrissimpkins / gist:5bf5686bae86b8129bee
Last active March 6, 2023 00:10
Atom Editor Cheat Sheet: macOS

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
@chrissimpkins
chrissimpkins / graphql_example.py
Created February 14, 2023 21:09 — forked from gbaman/graphql_example.py
An example on using the Github GraphQL API with Python 3
# An example to get the remaining rate limit using the Github GraphQL API.
import requests
headers = {"Authorization": "Bearer YOUR API KEY"}
def run_query(query): # A simple function to use requests.post to make the API call. Note the json= section.
request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers)
if request.status_code == 200:
@chrissimpkins
chrissimpkins / mastodon_v4.0.2-maxchar-750.patch
Created December 22, 2022 03:31
Increase Mastodon 4.0.2 max post character count to 750
diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js
index 6a65f44da..b1e364451 100644
--- a/app/javascript/mastodon/features/compose/components/compose_form.js
+++ b/app/javascript/mastodon/features/compose/components/compose_form.js
@@ -90,7 +90,7 @@ class ComposeForm extends ImmutablePureComponent {
const fulltext = this.getFulltextForCharacterCounting();
const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0;
- return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (isOnlyWhitespace && !anyMedia));
+ return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 750 || (isOnlyWhitespace && !anyMedia));