Skip to content

Instantly share code, notes, and snippets.

@chrissimpkins
chrissimpkins / android-noto-sizes.txt
Created June 27, 2024 17:58
Noto font sizes on the Android OSP system
4.17 KiB noto-fonts/notosanslydian/NotoSansLydian-Regular.ttf
4.21 KiB noto-fonts/notosanslycian/NotoSansLycian-Regular.ttf
4.29 KiB noto-fonts/notosanshatran/NotoSansHatran-Regular.otf
4.36 KiB noto-fonts/notosansogham/NotoSansOgham-Regular.ttf
4.61 KiB noto-fonts/notosansoldsoutharabian/NotoSansOldSouthArabian-Regular.ttf
4.78 KiB noto-fonts/notosansbuhid/NotoSansBuhid-Regular.ttf
4.88 KiB noto-fonts/notosansolditalic/NotoSansOldItalic-Regular.ttf
5.28 KiB noto-fonts/notosansphoenician/NotoSansPhoenician-Regular.ttf
5.46 KiB noto-fonts/notosanstagbanwa/NotoSansTagbanwa-Regular.ttf
5.50 KiB noto-fonts/notosansimperialaramaic/NotoSansImperialAramaic-Regular.ttf
#!/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.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.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 / 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));
@chrissimpkins
chrissimpkins / mastodon_v4.0.2-maxchar-1000.patch
Created December 22, 2022 03:29
Increase Mastodon 4.0.2 max post character count to 1000
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) > 1000 || (isOnlyWhitespace && !anyMedia));
@chrissimpkins
chrissimpkins / mastodon_v4.0.2-maxchar-1500.patch
Created December 22, 2022 03:28
Increase Mastodon 4.0.2 max post character count to 1500
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) > 1500 || (isOnlyWhitespace && !anyMedia));
@chrissimpkins
chrissimpkins / mastodon_v4.0.2-maxchar-2500.patch
Created December 22, 2022 03:26
Increase Mastodon 4.0.2 max post character count to 2500
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) > 2500 || (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));