Skip to content

Instantly share code, notes, and snippets.

View thibaudcolas's full-sized avatar
😀

Thibaud Colas thibaudcolas

😀
View GitHub Profile
@thibaudcolas
thibaudcolas / president-role.md
Created December 20, 2024 22:57
DSF President role

DSF President role

This is a copy of the DSF’s internal documentation on the DSF President officer role


🚧 Super rough notes, this needs filling out 🚧

Formally the President leads the Board, though that responsibility is vague.

@thibaudcolas
thibaudcolas / multi-tenancy.md
Created November 28, 2024 09:58
Multi-tenancy in Wagtail - by Andy Babic

Wagtail feature spec: Multi-tenancy

  • By Andy Babic, Senior Developer and Wagtail Consultant, Torchbox
  • 23 Aug 2022

What do we mean by Multi-tenancy?

It’s a way to split up large multi-site Wagtail instances in a way that makes it easier for editors to find and manage the things that are relevant to them.

@thibaudcolas
thibaudcolas / dsf-elections-turnout.md
Last active December 18, 2024 20:07
Django Software Foundation elections voter turnout

Over recent elections the data is readily available for

Elections Total voters Votes over first 7 days Total votes % 7 days % total
6.x Steering Council 400 215 215 20% 54%
2025 DSF Board 374 76 204 20% 55%
2024 DSF Board 287 93 132 32% 46%
5.x Steering Council 268 74 74 28% 28%
2023 DSF Board 244 58 91 24% 37%
@thibaudcolas
thibaudcolas / models.py
Last active October 30, 2024 13:40
Wagtail snippet to have fields that are only required as part of publishing, rather than when saving drafts.
# Example code to demonstrate how this works in practice
@publish_requires("date_published", block_schedule=True)
class BlogPage(Page):
# […]
date_published = models.DateField("Date article published", blank=True, null=True)
@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
}