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
@dan-mckay
dan-mckay / gist:4ec121f89bace770e9ec
Last active Feb 26, 2016
Page Level SMIL - Par approach
View gist:4ec121f89bace770e9ec
<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>
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
dan-mckay / RCE-Semantic-Commit-Ref.md
Last active May 29, 2018
RCE Semantic Commit Reference
View RCE-Semantic-Commit-Ref.md
View linux-adduser.md

Add User Linux

Add user called newuser, when logged in as root:

$ adduser newuser

To grant root privileges, open this file with default editor (nano):

/usr/sbin/visudo

Add the user’s name and the same permissions as root under the the user privilege specification

@dan-mckay
dan-mckay / gist:802ff9b250a9e2b5d957
Created Jun 26, 2014
iOS 7 status bar fix in JS
View gist:802ff9b250a9e2b5d957
if(navigator.userAgent.match(/iPhone; CPU iPhone OS 7_0/)) {
document.write('<style type="text/css">body{-webkit-transform: translate3d(0,20px,0)}</style>');
}
@dan-mckay
dan-mckay / Commands.md
Last active Dec 23, 2015
Useful Unix Commands for Mac
View Commands.md

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 Dec 22, 2015
Managing Android emulators from the command line.
View Android-Emulators.md

###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 Apr 23, 2013
standard firmata compatible with johnny-five
View gist:5442108
/*
* 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 Apr 16, 2013
Processing code for gesture based system
View gesture.pde
import SimpleOpenNI.*;
import ddf.minim.*;
SimpleOpenNI kinect;
Minim minim;
AudioSnippet player1;
AudioSnippet player2;
AudioSnippet player3;
AudioSnippet player4;
@dan-mckay
dan-mckay / DepthImage.pde
Created Apr 16, 2013
A sample script in Processing from simple-openni that visualises depth map data from a Kinect
View DepthImage.pde
import SimpleOpenNI.*;
SimpleOpenNI context;
void setup()
{
context = new SimpleOpenNI(this);
// mirror is by default enabled
You can’t perform that action at this time.