Skip to content

Instantly share code, notes, and snippets.

View simonwhatley's full-sized avatar

Simon Whatley simonwhatley

View GitHub Profile
@alextea
alextea / accessible-autocomplete-prototype-kit.md
Last active December 7, 2022 17:03
This is a step by step guide on how to use the accessible autocomplete component in the GOV.UK prototype kit

Using accessible autocomplete in the GOV.UK prototype kit

This is a step by step guide on how to use the accessible autocomplete component in the GOV.UK prototype kit. There aren’t any instructions included with the code for using with the prototype kit, and it’s not straightforward if you’re not familiar with javascript.

I have an example repo you can download to check the code.

Download

Download the accessible autocomplete code, you can download the zip or clone the repo if you prefer to use git.

Copy the files to your prototype

Copy the minified files from the /dist folder to your prototype.

@adamsilver
adamsilver / Validator.js
Last active August 6, 2020 14:33
Server side form validator component for Express
function Validator(req, res) {
this.req = req;
this.res = res;
this.validators = [];
this.errors = [];
}
Validator.prototype.add = function(name, rules) {
this.validators.push({
name: name,
@benjystanton
benjystanton / accessible-interactive-maps-draft.md
Last active November 30, 2020 08:25
Accessible interactive maps (draft)
@edwardhorsford
edwardhorsford / filters.js
Last active October 28, 2022 13:55
Useful Nunjucks filters for the GOV.UK Prototype Kit
/*
=====================================================================
arrayToGovukTable
Convert an array to form needed for govukTable macro
=====================================================================
Expects array or nested array.
Usage:
router.get('/section-1*', function(req, res, next){
res.locals['serviceName'] = foo
next()
})
@colinrotherham
colinrotherham / _autocomplete.scss
Last active November 21, 2018 10:15
GOV.UK Accessible Autocomplete Sass
.autocomplete__wrapper {
position: relative;
}
.autocomplete__hint,
.autocomplete__input {
-webkit-appearance: none;
border: 2px solid;
border-radius: 0; /* Safari 10 on iOS adds implicit border rounding. */
box-sizing: border-box;
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active September 20, 2024 17:41
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@d2s
d2s / installing-node-with-nvm.md
Last active August 10, 2024 04:45
Installing Node.js to Linux & macOS & WSL with nvm

Installing Node.js with nvm to Linux & macOS & WSL

A quick guide on how to setup Node.js development environment.

Install nvm for managing Node.js versions

nvm allows installing several versions of Node.js to the same system. Sometimes applications require a certain versions of Node.js to work. Having the flexibility of using specific versions can help.

  1. Open new Terminal window.
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@bomberstudios
bomberstudios / sketch-plugins.md
Last active February 26, 2024 07:02
A list of Sketch plugins hosted at GitHub, in no particular order.