Skip to content

Instantly share code, notes, and snippets.

{% set values = [
"apples",
"oranges",
"pears",
"bananas"
] %}
<select name="fruit" class="govuk-select">
{% for value in values %}
<option value="{{ value }}" {% if data["fruit"] == value %} selected {% endif %}>
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")
}
const express = require('express')
const router = express.Router()
// Add your routes here - above the module.exports line
router.get('/example', function(request, response){
var addresses = []
for (var i = 2; i<60; i+=2){
Application Basics
------------------
Name: Firefox
Version: 76.0.1
Build ID: 20200507114007
Update Channel: release
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:76.0) Gecko/20100101 Firefox/76.0
OS: Darwin 18.7.0
Multiprocess Windows: 1/1 Enabled by default
router.get('/section-1*', function(req, res, next){
res.locals['serviceName'] = foo
next()
})
_asyncToGenerator(function* () {
const executablePath = (isLambda) ? __dirname + '/headless-chromium' : '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
console.log('executablePath: ' + executablePath);
const browser = yield puppeteer.launch({
args: ['--no-sandbox',
'--disable-setuid-sandbox',
'--single-process',
'--homedir=/tmp',
'--data-path=/tmp/data-path',
const browser = await puppeteer.launch({
args: ['--no-sandbox',
'--disable-setuid-sandbox',
'--single-process',
'--homedir=/tmp',
'--data-path=/tmp/data-path',
'--disk-cache-dir=/tmp/cache-dir'],
executablePath: executablePath
});
const inputHTML = 'file://' + __dirname + '/input.html'
@joelanman
joelanman / README.md
Last active March 14, 2018 18:35
How to build a static version of ImageMagick with the libsrvg delegate

How to build a static version of ImageMagick with the librsvg delegate

You can't. From looking at ImageMagick's configure script it does not appear to look for any svg/rsvg delegate folder in order to make a static version.

I'm publishing this to try and make a Google result so other people don't wase their time trying :)

An alternative is to use rsvg-convert directly to convert from SVG to PNG.

@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