Skip to content

Instantly share code, notes, and snippets.

Daniel McKay dan-mckay

Block or report user

Report or block dan-mckay

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

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: [
View Installation
1. Install Mongodb - I used Homebrew
2. sudo mkdir -p /data/db
3. sudo chown <username> /data/db
4. mongod - (runs mongo)
dan-mckay / gist:4ec121f89bace770e9ec
Last active Feb 26, 2016
Page Level SMIL - Par approach
View gist:4ec121f89bace770e9ec
<smil xmlns="" xmlns:epub="" version="3.0">
<seq epub:textref="the_horror.xhtml">
<text src="../../s9ml/the_thrill_of_horror/the_horror.xhtml#data-uuid-dcd02aaaf7fa46dcb9c94cf1a3cab096" />
<audio clipBegin="00:00:00.000" clipEnd="00:00:01.169" src="../../audio/sn_77e0-c02-s04-038.mp3"/>
<par epub:type="learning-resource">
<text src="page.xhtml#id-of-element-that-forces-stop" />
View gist:7d08c59398129beaf391
export async function load({id, src, onEnd}) {
try {
const node = await createNode(src, onEnd);
nodes[id] = node;
return {
duration: node.duration()
} catch(error) {
throw error;
dan-mckay /
Last active May 29, 2018
RCE Semantic Commit Reference
You can’t perform that action at this time.