Skip to content

Instantly share code, notes, and snippets.

View gazjoy's full-sized avatar
🦆

Gareth Joyce gazjoy

🦆
View GitHub Profile
@selfthinker
selfthinker / intentionally-inaccessible.md
Last active March 11, 2026 20:19
Intentionally inaccessible websites

Intentionally inaccessible websites (and apps)

People make intentionally inaccessible websites for various educational purposes: training, empathy, tests, demos, etc. This lists all such websites I am aware of. Please let me know if you know of any others to be added to this list.

website explanations by license last update
BrowserStack Demo (none) BrowserStack (none) ?
Awesome Recipes (from Deque University Demo Sites) (none) Deque (none) ?
Dream Destination (from Deque University Demo Sites) (none) Deque (none) ?
router.get("/letters-contact-preference-audio", function(request, response){
let preferences = request.session.data['lettersContactPreference']
if (preferences.length && preferences.includes('audio'){
response.render("letters-contact-preference-audio")
} else {
response.redirect("/letters-contact-preference-braille")
}
@robpataki
robpataki / nunjucks-snippets.njk
Created November 15, 2018 14:27
Nunjucks snippets
{# Conditionally render inline CSS class #}
<div class="govuk-grid-row {{ 'govuk-!-margin-top-9' if not(showBackButton) else 'govuk-!-margin-top-3' }}">
@robpataki
robpataki / time-travel.js
Created September 19, 2018 12:35
Display moment style dates in the front-end
/*
Example usage:
<span class="moment" data-moment="add 12 days"></span>
*/
'use strict'
import moment from 'moment'
/* TimeTravel */
@robpataki
robpataki / how-we-do-git.md
Last active February 14, 2025 18:21
This is how we do git (rebase, feature branches, PRs)

How to / Git

Branching strategy

We use a form of Git flow to maintain a stable master branch, and work off feature branches to introduce new features and other code updates. The feature branches are tied to JIRA tickets.

To keep our git log clean and tidy we use git's rebase strategy. That means that instead of merging commits in and out of the master branch (resulting in many ugly merge commits) we always keep our own feature branch's commits on top of the existing master branch commits.

You can read more about the rebase strategy here: https://www.atlassian.com/git/tutorials/merging-vs-rebasing.

@joelanman
joelanman / routes.js
Last active June 29, 2018 09:42
how to use marked
const express = require('express')
const router = express.Router()
const marked = require('marked')
// Route index page
router.get('/', function (req, res) {
res.render('index')
})
// Add your routes here - above the module.exports line

Accessibility criteria for Modal Dialog - WIP

User story

As an Assistive Technology (AT) user, I want to be informed that a modal dialog has opened, what its purpose is, and how to action / close it.

Acceptance criteria

The modal dialog must:

@atelierbram
atelierbram / set-active-class-in-nunjucks.md
Last active January 20, 2025 10:30
Set Active Class on Nav-Menu-Item in Nunjucks

In html/about/index.html:

{% extends "layouts/layout.njk" %}

{% set base_path = "../../" %}
{% set page_title = "about" %} 

In data.json:

This list was made using ONDAS and AddressBase. Here's a rough giude to how it was made:

  1. Get ONSAD
  • Get a CSV file with UPRN,Postcode, I got this from the AddressBase
  • Install csvkit
  • Remove all the columns in ONSAD that we don't care about (we only want the 'LAD' column): cat ../ONSAD_JAN_2017/Data/*.csv | csvcut -c 1,3 > uprn_lad.csv
  • We now have two CSV files, each with two columns. One UPRN,postcode the other UPRN,LAD.
  • Run join.py to join the two files in to a single file with 3 columns
  • Make a file with postcode,lad: cat joined.csv | csvcut -c 3,2 > postcode_lad.csv
  • Filter out duplicate rows: sort -u postcode_lad.csv&gt; unique_rows.csv
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active March 9, 2026 20:25
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.