Mounting shared folders between OSX and the docker container is tricky due to
the intermediate boot2docker VM. You can't use the usual docker -v
option as
the docker server knows nothing about the OSX filesystem - it can only mount
folders from the boot2docker filesystem. Fortunately, you can work around this
using SSHFS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {Event} evt | |
* @return {Object} | |
*/ | |
function getMousePosition(evt) { | |
var pageX = evt.pageX; | |
var pageY = evt.pageY; | |
if (pageX === undefined) { | |
pageX = evt.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var preventMultipleInstances = function(window) { | |
var socket = (process.platform === 'win32') ? '\\\\.\\pipe\\myapp-sock' : path.join(os.tmpdir(), 'myapp.sock'); | |
net.connect({path: socket}, function () { | |
var errorMessage = 'Another instance of ' + pjson.productName + ' is already running. Only one instance of the app can be open at a time.' | |
dialog.showMessageBox(window, {'type': 'error', message: errorMessage, buttons: ['OK']}, function() { | |
window.destroy() | |
}) | |
}).on('error', function (err) { | |
if (process.platform !== 'win32') { | |
// try to unlink older socket if it exists, if it doesn't, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'), | |
sass = require('gulp-sass'), | |
browserify = require('gulp-browserify'), | |
concat = require('gulp-concat'), | |
embedlr = require('gulp-embedlr'), | |
refresh = require('gulp-livereload'), | |
lrserver = require('tiny-lr')(), | |
express = require('express'), | |
livereload = require('connect-livereload') | |
livereloadport = 35729, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple 16 step drum machine experiment with Node and CoffeeScript | |
# by Peter Cooper - @peterc | |
# | |
# Inspired by Giles Bowkett's screencast at | |
# http://gilesbowkett.blogspot.com/2012/02/making-music-with-javascript-is-easy.html | |
# | |
# Screencast demo of this code at http://www.youtube.com/watch?v=qWKkEaKL6DQ | |
# | |
# Required: | |
# node, npm and coffee-script installed |