Skip to content

Instantly share code, notes, and snippets.

View dan-mckay's full-sized avatar

Daniel McKay dan-mckay

View GitHub Profile

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: [
1. Install Mongodb - I used Homebrew
2. sudo mkdir -p /data/db
3. sudo chown <username> /data/db
4. mongod - (runs mongo)
@dan-mckay
dan-mckay / gist:4ec121f89bace770e9ec
Last active February 26, 2016 12:26
Page Level SMIL - Par approach
<smil xmlns="http://www.w3.org/ns/SMIL" xmlns:epub="http://www.idpf.org/2007/ops" version="3.0">
<body>
<seq epub:textref="the_horror.xhtml">
<par>
<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>
<par epub:type="learning-resource">
<text src="page.xhtml#id-of-element-that-forces-stop" />
</par>
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
dan-mckay / Commands.md
Last active December 23, 2015 12:19
Useful Unix Commands for Mac

Useful Unix Commands for Mac

List all symlinks in a directory

ls -la . | grep "\->"

Make a symlink

ln -s path/to/real/file path/to/symlink

Delete a symlink - same as removing a file

@dan-mckay
dan-mckay / Android-Emulators.md
Last active December 22, 2015 05:29
Managing Android emulators from the command line.

###Managing Android Virtual Devices (AVDs) from the Command Line

First, view a list of Android system image targets on your local machine

android list targets

Sample output:

id: 1 or "android-16"

Name: Android 4.1.2

@dan-mckay
dan-mckay / gist:5442108
Created April 23, 2013 09:22
standard firmata compatible with johnny-five
/*
* Firmata is a generic protocol for communicating with microcontrollers
* from software on a host computer. It is intended to work with
* any host computer software package.
*
* To download a host software package, please clink on the following link
* to open the download page in your default browser.
*
* http://firmata.org/wiki/Download
*/
@dan-mckay
dan-mckay / gesture.pde
Created April 16, 2013 22:16
Processing code for gesture based system
import SimpleOpenNI.*;
import ddf.minim.*;
SimpleOpenNI kinect;
Minim minim;
AudioSnippet player1;
AudioSnippet player2;
AudioSnippet player3;
AudioSnippet player4;