Skip to content

Instantly share code, notes, and snippets.

@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 / ast2text.py
Created January 14, 2020 21:44 — forked from kylehowells/ast2text.py
Extract the plain text from markdown, for plain text search.
import commonmark
with open('test.md', 'r') as myfile:
text = myfile.read()
parser = commonmark.Parser()
ast = parser.parse(text)
# Returns the text from markdown, stripped of the markdown syntax itself
def ast2text(astNode):

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@chrissimpkins
chrissimpkins / hack4tex
Last active October 14, 2021 14:31 — forked from gramian/hack4tex
A small script to use the hack truetype font in pdflatex
#!/bin/sh
# hack4tex 0.1
# Copyright (c) 2016 Christian Himpe
# released under BSD 2-Clause License ( opensource.org/licenses/BSD-2-Clause )
# based on Stephan Lehmke's answer to "How do I use TrueType Fonts with PDFTeX
# using otftotfm?" on tex.stackexchange.com/a/52902
#
# requires otftotfm which is part of lcdf-typetools
#
@chrissimpkins
chrissimpkins / TrueColour.md
Created January 16, 2020 05:24 — forked from XVilka/TrueColour.md
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
chrissimpkins / check-alwayspass.py
Last active August 14, 2020 16:43
Fontbakery always pass custom profile for testing
# Copyright 2020 Christopher Simpkins
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@chrissimpkins
chrissimpkins / bracket-layer-edit.py
Created June 23, 2020 21:14
Modify glyphs source file bracket layer size
# Copyright 2020 Christopher Simpkins
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
name: Script + Writing System Coverage
on: [push, pull_request]
jobs:
cldr-coverage-support:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]