Skip to content

Instantly share code, notes, and snippets.

View thibaudcolas's full-sized avatar
😀

Thibaud Colas thibaudcolas

😀
View GitHub Profile
@thibaudcolas
thibaudcolas / proposed-alt-flow.md
Last active July 16, 2024 06:39
Alt text generation flow chart in Wagtail

Alt text generation flow chart in Wagtail

As-is alt flow

Top-down

flowchart TD
    Start[🖼️ Image in the CMS] --> B{Vanilla image model\n alt text\n implementation?}
    B -- Yes --> G
@thibaudcolas
thibaudcolas / readability-formulas.md
Last active July 12, 2024 11:20
Readability formulas recap

Taken from

Perusal of readability with focus on web content understandability

Pawan Kumar Ojha, Abid Ismail, Kuppusamy Kundumani Srinivasan, Journal of King Saud University - Computer and Information Sciences, Volume 33, Issue 1, 2021, Pages 1-10, ISSN 1319-1578,

DOI: https://doi.org/10.1016/j.jksuci.2018.03.007

| Attributes | FRE | Dale-Chall readability | FKGL | Gunning Fog Index | SMOG | ARI | FRY | Forcast | PSK | SPACHE | CLI | BRI | LI× | Raygor Estimate Graph | Djoko Formula | New Fog Count | Pisarek’s Index | Fernandez Huerta Index | Kandal and Moles Index | Al-Heeti Grade Level | Lexile |

@thibaudcolas
thibaudcolas / README.md
Last active July 2, 2024 16:45
Real-world example of Wagtail structured content importing

For wagtail-content-import. Uses mammoth to convert .docx to HTML, rather than python-docx.

Settings:

WAGTAILCONTENTIMPORT_DOCX_PARSER = "content_import_parsers.DocxHTMLParser"

Mapper to a page’s body StreamBlock:

@thibaudcolas
thibaudcolas / code-search.md
Last active June 10, 2024 08:47
Local code search across repositories

Local code search

Sample scripts to fetch recently-used repositories in bulk from GitHub and GitLab.

With basic filtering of specific repositories, and of specific files within repositories.

Search

Use your local copy of the code with ag The Silver Searcher, ripgrep, or your IDE.

@thibaudcolas
thibaudcolas / browser-features-support.md
Created May 28, 2024 13:18
Django browser feature usage per version
effort
2h

Tasks

  • [ ]
@thibaudcolas
thibaudcolas / [...slug].tsx
Created May 7, 2024 21:09
Next.js + GraphQL + Wagtail dynamic page type routing
import { gql } from 'graphql-tag';
// Generic `page` query, by site and URL path (unique per site).
export const pageQuery = gql`
query ($urlPath: String, $siteId: ID, $previewToken: String) {
site(id: $siteId) {
id
page(urlPath: $urlPath, token: $previewToken) {
...getBaseContentPageFields
}
@thibaudcolas
thibaudcolas / package-maintainers-dsf-wg.md
Last active April 11, 2024 09:36
Draft: Package maintainers DSF working group charter

Package Maintainers Working Group

Scope of responsibilities

This group supports package maintainers in the Django ecosystem. Packages are an important part of the experience of using Django, and their maintainers can benefit from different forms of support than Django contributors and users.

The goals of the group are:

  • To facilitate discussions and share knowledge about common issues or tasks in package maintenance.
@thibaudcolas
thibaudcolas / outlines.md
Last active April 9, 2024 23:54
HTTP Archive accessibility chapter outlines

HTTP Archive accessibility chapter outlines

Side by side

Chapter outlines as a spreadsheet

| 2022 | 2021 | 2020 | 2019 | | ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------

@thibaudcolas
thibaudcolas / README.md
Last active June 20, 2024 18:50
Django - Wagtail packages ecosystem on PyPI - 2024-03-04, 30 days, wheel packages only
@thibaudcolas
thibaudcolas / django-wagtail-2024-03-04-30days-wheels.csv
Created March 15, 2024 14:50
Django - Wagtail packages ecosystem on PyPI - 2024-03-04, 30 days, wheel packages only
We can't make this file beautiful and searchable because it's too large.
name,downloads_count,latest_release,author,license,home_page,requires_python,classifiers,requires_dist,upload_time,,,"Figures as of 2024-03-04, 30-days downloads"
django,12720908,,,,,,,,,,,Query:
djangorestframework,6783146,3.14.0,Tom Christie,BSD,https://www.django-rest-framework.org/,>=3.6,"[Development Status :: 5 - Production/Stable,Environment :: Web Environment,Framework :: Django,Framework :: Django :: 3.0,Framework :: Django :: 3.1,Framework :: Django :: 3.2,Framework :: Django :: 4.0,Framework :: Django :: 4.1,Intended Audience :: Developers,License :: OSI Approved :: BSD License,Operating System :: OS Independent,Programming Language :: Python,Programming Language :: Python :: 3,Programming Language :: Python :: 3.6,Programming Language :: Python :: 3.7,Programming Language :: Python :: 3.8,Programming Language :: Python :: 3.9,Programming Language :: Python :: 3.10,Programming Language :: Python :: 3 :: Only,Topic :: Internet :: WWW/HTTP]","[django (>=3.0),pytz]",2022-09-22 11:38:41.825785 UTC,,,ht