Skip to content

Instantly share code, notes, and snippets.

View dan-mckay's full-sized avatar

Daniel McKay dan-mckay

View GitHub Profile
@dan-mckay
dan-mckay / index.html
Created October 29, 2019 11:58
Simple client for writing to a `user` table with Hasura
<html lang="en">
<head>
<meta charset="utf-8">
<title>fetch hasura</title>
</head>
<body>
<form id="create_user_form">
@dan-mckay
dan-mckay / hasura-get-started.md
Created October 2, 2019 15:42
hasura get started

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 (
 id INT PRIMARY KEY,
@dan-mckay
dan-mckay / docker-hasura.md
Last active October 2, 2019 15:56
docker hasura setup
@dan-mckay
dan-mckay / docker-bits.md
Last active October 2, 2019 15:03
Docker

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.

@dan-mckay
dan-mckay / elastic-search-commands.md
Last active June 1, 2019 07:37
elasticsearch commands

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
dan-mckay / accessibility-basics.md
Created December 6, 2018 15:23
Accessibility Basic Notes

Accessibility

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
dan-mckay / reason-snippets.md
Created January 11, 2018 21:32
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
dan-mckay / fixed-layout-epub.md
Last active February 15, 2017 11:16
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 - ``

// 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: [