Skip to content

Instantly share code, notes, and snippets.

View dan-mckay's full-sized avatar

Daniel McKay dan-mckay

View GitHub Profile
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 / RCE-Semantic-Commit-Ref.md
Last active May 29, 2018 19:06
RCE Semantic Commit Reference

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:edb8b88585c2c89ca610
Last active July 17, 2020 10:37 — forked from mikenairn/gist:c8fdedc420d24d5f891f
ENG _ REBASE_YOUR_COMMITS!!!

Update all remotes

git fetch --all

Change to my branch

git checkout my-branch
@dan-mckay
dan-mckay / gist:802ff9b250a9e2b5d957
Created June 26, 2014 14:34
iOS 7 status bar fix in JS
if(navigator.userAgent.match(/iPhone; CPU iPhone OS 7_0/)) {
document.write('<style type="text/css">body{-webkit-transform: translate3d(0,20px,0)}</style>');
}

Common git commands

View local commits not in origin/master

git log origin/master..HEAD

Reset local repo back to remote repo head

git reset --hard origin/master
@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