Skip to content

Instantly share code, notes, and snippets.

@johnrees
johnrees / a11y.js
Created November 29, 2019 22:30
js to make cargocollective a bit more accessibility friendly
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 October 2, 2019 13:34
install duckling
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
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
const fs = require("fs");
const file = fs.readFileSync(".gitmodules").toString();
function parseGitModules(data, _callback) {
var gitModules = data.split("["),
subModulesCollections = [];
gitModules.forEach(function(submodules) {
if (/^submodule*/.test(submodules)) {
Actions {
:branch
:create_node
:update_node
:remove_node
:create_edge
:remove_edge
}
Action.create(type, actor, at, payload)
Scene.near('hackney, london, uk', 50, units: :km).where('data::text ilike ?', '%Building%').map{|s| s.data['url']}.count
tap "heroku/brew"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-drivers"
tap "homebrew/cask-fonts"
tap "homebrew/core"
brew "atomicparsley"
brew "direnv"
brew "ffmpeg"
brew "gnupg"
tap "heroku/brew"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "homebrew/core"
brew "gnupg"
brew "hub"
brew "hugo"
brew "yarn"
brew "heroku/brew/heroku"
{
"type": "photo",
"title": "Minchinhampton Common",
"author_name": "Helena Downton",
"author_url": "http://www.geograph.org.uk/profile/5",
"web_page": "http://www.geograph.org.uk/photo/7",
"thumbnail_url": "http://s3.geograph.org.uk/photos/00/00/000007_ce524193_120x120.jpg",
"thumbnail_width": "120",
"thumbnail_height": "90",
"url": "http://s0.geograph.org.uk/photos/00/00/000007_ce524193.jpg",
@johnrees
johnrees / install.sh
Created November 5, 2018 13:24
Install ruby pg gem with Postgres.app
gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config