Skip to content

Instantly share code, notes, and snippets.

View test.url
https://607da3a4eb1e3d00cb181d22--planx-new.netlify.app
View ot.ts
export namespace OT {
export type path = Array<string | number>;
export namespace Object {
export interface Add {
p: OT.path;
oi: any;
}
export interface Remove {
p: OT.path;
View 0_graph.ascii
+------------------+
| what are your |
| favourite foods? |
+------------------+
| |
+--------+ +-----------+
| Fruit | | Vegetable |
+--------+ +-----------+
| | |
View floodplain.jsonp
jQuery16409206660056944054_1598628602502(
[{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"id": "1",
"geometry": {
"type": "Polygon",
"coordinates": [
[
View out.json
This file has been truncated, but you can view the full file.
{
"id": "90550b42-8947-4f45-920a-210b8d817a22",
"name": "Root",
"nodes": {
"d7893039-e30e-40b1-a3ac-9ec491435b3c": {
"text": "My postcode is ",
"$t": 100
},
"34637287-ffb6-473d-ab5d-e8bcb7e4fd4e": {
View out.json
This file has been truncated, but you can view the full file.
{
"id": "2109c415-69f7-466e-bfec-1ce01cd6cb7a",
"name": "Root",
"nodes": {
"7af9ea3e-acc9-4467-a6c2-f0560b3a6352": {
"text": "My postcode is ",
"$t": 1000
},
"ee2bc065-6f48-415f-b02d-454f091bc9e2": {
@johnrees
johnrees / parse.ts
Created Dec 2, 2019
ts-morph ts-simple-ast
View parse.ts
// https://ts-ast-viewer.com/#code/GYVwdgxgLglg9mABACwKYBt1wBRgIYC2qAXIgM5QBOMYA5gDSJ5hxRqWIC8iA5GpnB4BKUhWp1EAbwBQiRJVRQQlJAAN+WRABJJ+IgF9VAbmn6gA
import { Project, SyntaxKind } from "ts-morph";
const project = new Project({});
project.addExistingSourceFiles("./src/thing.ts");
const node = project.getSourceFileOrThrow("./src/thing.ts");
const result = node.forEachDescendant((node, traversal) => {
@johnrees
johnrees / a11y.js
Created Nov 29, 2019
js to make cargocollective a bit more accessibility friendly
View a11y.js
try {
// add img alt tags using filename
document.addEventListener(
"DOMContentLoaded",
function() {
[...document.getElementsByTagName("img")].forEach(i => {
i.alt = i.src
.split("/")
.pop()
.split(".")
@johnrees
johnrees / duckling.sh
Created Oct 2, 2019
install duckling
View duckling.sh
adduser ducklinguser --ingroup admin
su ducklinguser
cd
echo "export PATH=$PATH:~/.local/bin" >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/facebook/duckling
cd duckling
sudo apt-get update -y
sudo apt-get install build-essential libpcre++-dev libpcre3-dev -y
stack build && stack test && stack install
View ThemeDecorator.tsx
import { createMuiTheme } from "@material-ui/core";
import red from "@material-ui/core/colors/red";
import ThemeProvider from "@material-ui/styles/ThemeProvider";
import React from "react";
const themes = {
default: createMuiTheme({}),
red: createMuiTheme({
palette: {
primary: red