Skip to content

Instantly share code, notes, and snippets.


Glen glen-84

  • Cape Town, South Africa
View GitHub Profile
glen-84 / index.ts
Created Apr 20, 2021
Koa middleware for Rendertron.
View index.ts
import axios from "axios";
import type {IncomingMessage} from "node:http";
import type {Middleware} from "koa";
* A default set of user agent patterns for bots/crawlers that do not perform
* well with pages that require JavaScript.
export const botUserAgents = [
// spell-checker:disable
glen-84 / gg-number-array.ts
Created Feb 13, 2019
Number array custom attribute
View gg-number-array.ts
import {autoinject, bindingMode, customAttribute} from "aurelia-framework";
* Ensures that array elements are numbers.
* TODO: Using this custom attribute because value converters and binding behaviors are not working well with
* multi-select elements. See
@customAttribute("gg-number-array", bindingMode.twoWay)
glen-84 / app.html
Last active Aug 21, 2017 — forked from jdanyow/app.html
Aurelia set select options and value
View app.html
<li>Click the "Set value" button (selected option changes correctly)</li>
<li>Increment number to 3</li>
<li>Click the "Set options and value" button (selected option is not set correctly)</li>
<select value.bind="">
glen-84 / app.html
Created Mar 5, 2017 — forked from PWKad/app.html
DI inheritance
View app.html
<h1>Dialog Repro</h1>
<button click.delegate="submit()">Open Dialog</button>
View app.html
<require from="./select2-custom-attribute"></require>
<require from="./debug"></require>
<h1>Standard Select</h1>
<select value.bind="selectedThings" style="width: 100%">
<option repeat.for="thing of things" model.bind="thing">${}</option>
View letter-to-dc.txt
I'm noticing that a disturbing number of package managers[1] and other software projects[2] are making use of JSON as a
configuration format, which is starting to bother me (probably more than it should), since JSON is a data serialization
format, and was not intended for this purpose (as I understand it).
Have you considered writing a new specification for a format that is more suited to such uses? Something similar to
JSON5 or YAML. YAML is pretty cool, but people don't like/use it because (I assume):
1. It has a stupid name.
View typings.d.ts
// Note: The definitions below are incomplete, they are just used to satisfy the TypeScript compiler for now.
declare module "glob2base" {
var glob2base: any;
export = glob2base;
declare module "gulp" {
var gulp: any;
export = gulp;
View gulpfile.js
var gulp = require("gulp");
var browserSync = require("browser-sync").create();
var swagger = require("swagger-parser");
var fs = require("fs");
gulp.task("serve", function() {
open: false,
server: {
baseDir: "./",
View gist:dc86ea06cdbd99d72598
@font-face {
font-family: 'icomoon';
glen-84 / LazySaveHandler.php
Last active Dec 16, 2015
Lazy session handler for ZF2
View LazySaveHandler.php
namespace Apex\Session;
use Zend\Session\SaveHandler\SaveHandlerInterface;
* Based on
* @author Glen