Skip to content

Instantly share code, notes, and snippets.


Daniel McKay dan-mckay

View GitHub Profile
dan-mckay / index.html
Created Oct 29, 2019
Simple client for writing to a `user` table with Hasura
View index.html
<html lang="en">
<meta charset="utf-8">
<title>fetch hasura</title>
<form id="create_user_form">

Hasura - get started

Create a table

Go to http://localhost:8080/console and navigate to Data -> Create table

For example, let us go with a user table with the following rows:

user (
dan-mckay /
Last active Oct 2, 2019
docker hasura setup

Docker Stuff

It provides all the files and code your container will need. Running the docker build command creates a Docker image using the Dockerfile. This built image is in your machine's local Docker image registry

Create Docker image with name with path to docker file

docker build -t <username>/<name-of-image> ./path/to/Dockerfile

Running a container launches your software with private resources, securely isolated from the rest of your machine.


populate the database with dummy data from json file in cwd called test-data.json

curl -H "Content-Type: application/json" -XPOST "http://localhost:9200/product/default/_bulk?pretty" --data-binary "@test-data.json"
dan-mckay /
Created Dec 6, 2018
Accessibility Basic Notes


Free Code Camp Notes

Three things to look out for:

  • Code should be well organised and use the appropriate html elements
  • Ensure test alternatives exist for visual content
  • Provide keyboard navigation
dan-mckay /
Created Jan 11, 2018
Reason commands, snippets etc

ReasonML Commands, Snippets, etc

Create a Reason App

bsb -init app-name-here -theme basic-reason

Create a ReasonReact App

bsb -init my-react-app -theme react

Set Up

Run mysql as root on port 3306 (password: 123)

docker run --name db -d -e MYSQL_ROOT_PASSWORD=123 -p 3306:3306 mysql:latest

Get running docker processes

docker ps
dan-mckay /
Last active Feb 15, 2017
Notes on what we should parse from fixed layout epub

Fixed Layout Epubs

The rendition:layout property

  • pre-paginated
  • reflowable default

Book - <meta property="rendition:layout">pre-paginated</meta>

Spine - <itemref id="titlepage" properties="rendition:layout-pre-paginated"/>

View rollup-config-with-eslint.js
// Rollup plugins
import babel from 'rollup-plugin-babel';
import eslint from 'rollup-plugin-eslint';
export default {
entry: 'src/scripts/main.js',
dest: 'build/js/main.min.js',
format: 'iife',
sourceMap: 'inline',
plugins: [
You can’t perform that action at this time.