Skip to content

Instantly share code, notes, and snippets.

View callumacrae's full-sized avatar

Callum Macrae callumacrae

View GitHub Profile
// @ts-check
const { test, expect } = require('@playwright/test');
test.beforeEach(async ({ page }) => {
await page.goto('https://demo.playwright.dev/todomvc');
});
const TODO_ITEMS = [
'buy some cheese',
'feed the cat',
@callumacrae
callumacrae / .block
Last active April 13, 2018 13:30 — forked from mbostock/.block
World Map
license: gpl-3.0
import { keymap } from './keypress-promise';
// import CrapEventEmitter from './crap-event-emitter';
const page = {
id: 'page',
speech: 'voiceover-demo, web content',
children: [
{
id: 'main-heading',
speech: 'heading level 1, Example page',
@callumacrae
callumacrae / .block
Last active March 8, 2017 11:46 — forked from mbostock/.block
Threshold Choropleth
license: gpl-3.0
@callumacrae
callumacrae / .block
Last active March 8, 2017 11:40 — forked from mbostock/.block
Area Choropleth
license: gpl-3.0
const gulp = require('gulp');
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const webpackConfig = require('./webpack.config.js');
gulp.task('js:build', function (done) {
webpack(webpackConfig('js:build'), function (err, stats) {
if (err) {
throw err;
'use strict';
var path = require('path');
var findup = require('findup-sync');
var cache = {};
function sassNpmImporter(url, prev, done) {
// Fall back to old URL
var newUrl = url;
require('./module1');
import './module2';
// Output will be "module two" followed by "module one"
import Data.List (foldl1')
-- Factorial function
fact n = foldl1' (*) [1..n]
-- Permutation function
n `p` 0 = 1
n `p` 1 = n
n `p` r = foldl1' (*) [n-r+1..n]
@callumacrae
callumacrae / gist:73c69c72d95ecdedfcc4
Created September 22, 2015 16:36
basket with 29 books
Started GET "/cart" for ::1 at 2015-09-22 17:35:39 +0100
Processing by Mermaid::CartController#show as HTML
Spree::User Load (0.3ms) SELECT "spree_users".* FROM "spree_users" WHERE "spree_users"."deleted_at" IS NULL AND "spree_users"."id" = $1 LIMIT 1 [["id", 1]]
Cache read: spree/app_configuration/supported_currencies
Spree::Order Load (0.2ms) SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."completed_at" IS NULL AND "spree_orders"."user_id" = $1 AND "spree_orders"."guest_token" = $2 AND "spree_orders"."currency" = $3 LIMIT 1 [["user_id", 1], ["guest_token", "6NRkTjAVAUKRiHh3K6AeLw"], ["currency", "GBP"]]
Cache read: spree/app_configuration/supported_currencies
CACHE (0.0ms) SELECT "spree_users".* FROM "spree_users" WHERE "spree_users"."deleted_at" IS NULL AND "spree_users"."id" = $1 LIMIT 1 [["id", 1]]
Spree::LineItem Load (0.3ms) SELECT "spree_line_items".* FROM "spree_line_items" WHERE "spree_line_items"."order_id" = $1 ORDER BY spree_line_items.created_at ASC [["ord