Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<title>Example page</title>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@utrecht/design-tokens/dist/index.css" />
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@utrecht/component-library-css/dist/index.css" />
<style>
.my-theme {
--utrecht-button-background-color: tomato;
--utrecht-button-color: white;
@Robbert
Robbert / CLA.md
Created December 1, 2020 16:35
NL Design System - Contributor License Agreement (CLA)

CONTRIBUTOR LICENCE AGREEMENT

version 1.00 / 01-12-2020

This text of this document is licensed under the CC0 license.


The State of the Netherlands, Ministry of the Interior and Kingdom Relations (hereinafter: the Ministry) and the NL Design System Community (hereinafter: the Community) would like to utilise the knowledge of third parties in developing digital resources that could contribute to a Design System for the public sector (hereinafter referred to collectively as: the Digital Resources).

@Robbert
Robbert / index.xqy
Created June 19, 2017 19:10
XSLT includes in MarkLogic
xquery version "1.0-ml";
declare namespace xsl = "http://www.w3.org/1999/XSL/Transform";
declare namespace local = "urn:local";
declare function local:prepare-stylesheet($uri, $stylesheet)
{
let $void := xdmp:invoke-function(
function ()
{
@Robbert
Robbert / unicode.js
Created October 8, 2015 14:34
code-generated ternary regex madness
var Unicode = ({blocks:{'Alchemical-Symbols':{test:(function anonymous(n) {
return n >= 0x1F700 && n <= 0x1F77F
})}, 'Alphabetic-Presentation-Forms':{test:(function anonymous(n) {
return n >= 0xFB00 && n <= 0xFB4F
})}, 'Ancient-Greek-Musical-Notation':{test:(function anonymous(n) {
return n >= 0x1D200 && n <= 0x1D24F
})}, 'Ancient-Greek-Numbers':{test:(function anonymous(n) {
return n >= 0x10140 && n <= 0x1018F
})}, 'Ancient-Symbols':{test:(function anonymous(n) {
return n >= 0x10190 && n <= 0x101CF
@Robbert
Robbert / australian-ip.js
Created February 9, 2015 21:53
Australian IP address detection. Fast JavaScript proof of concept.
function isAustralianIP(n) {
return n >= 0x1000000 && (n >= 0x82740000 && (n >= 0xA5760000 && (n >= 0xCB1E1200 && (n >= 0xCBA60000 && (n >= 0xD2D74F00 && (n >= 0xDCEB0000 && (n >= 0xDCF40000 && (n >= 0xDD788000 && (n >= 0xDF1B4000 && (n >= 0xDFFFE800 && (n >= 0xDFFFFF00 || n <= 0xDFFFEBFF) || n <= 0xDFFC7FFF && (n <= 0xDFA57FFF && (n >= 0xDFA56000 || n <= 0xDF821FFF && (n <= 0xDF1DF3FF && (n >= 0xDF1BB000 && (n >= 0xDF1DF000 || n <= 0xDF1BB3FF) || n <= 0xDF1B67FF && (n <= 0xDF1B43FF || n >= 0xDF1B6000)) || n >= 0xDF820C00)) || n >= 0xDFFC0000)) || n <= 0xDF1B1FFF && (n >= 0xDD85C000 && (n >= 0xDF197000 && (n >= 0xDF1B1391 || n <= 0xDF1B138F && (n <= 0xDF19E7FF && (n >= 0xDF19E000 || n <= 0xDF1977FF) || n >= 0xDF1B0000)) || n <= 0xDEE55FFF && (n >= 0xDDC7D000 && (n >= 0xDEE55800 || n <= 0xDDC7DFFF) || n <= 0xDD85DFFF)) || n <= 0xDD799FFF && (n >= 0xDD798000 || n <= 0xDD795FFF && (n >= 0xDD794000 || n <= 0xDD78A7FF)))) || n <= 0xDCFDFFFF && (n >= 0xDCF7B000 && (n <= 0xDCF7B7FF || n >= 0xDCFD0000) || n <= 0xDC
/**
* @author Robbert Broersma <http://robbertbroersma.nl/>
* @license © 2013, The Knights Who Say NIH B.V. All rights reserved.
*/
var List = {};
/**
* Works like arr.splice(), but without constructing an array
* with the removed values to reduce garbage collection.
@Robbert
Robbert / mediatype.php
Created October 12, 2013 12:25
PHP function for testing for a media type in a Content-Type header, taking in account case insensitivity and the optional parameters like charset.
<?php
/**
* @author Robbert Broersma <http://robbertbroersma.nl/>
* @license Public Domain
*/
/**
* @see http://tools.ietf.org/html/rfc2046#appendix-A
* @see http://www.w3.org/Protocols/rfc1341/4_Content-Type.html
<?php
/*
# Example usage:
http_to_file("http://localhost/~robbert/example.com/img/");
// returns "/Users/Robbert/Sites/example.com/img/";
file_to_http("/Users/Robbert/Sites/example.com/style/mobile.css");
@Robbert
Robbert / message-id.php
Created February 16, 2013 17:51
Message-ID generator in PHP for mail headers.
<?php
/**
* @see http://www.jwz.org/doc/mid.html
*/
function generateMessageID()
{
return sprintf(
"<%s.%s@%s>",
base_convert(microtime(), 10, 36),