Skip to content

Instantly share code, notes, and snippets.

@joseph
joseph / Vagrantfile
Created March 22, 2012 04:14
Various fixes for Vagrant (Lucid64) on Mac OS X Lion
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Preventing kernel panics - VirtualBox 4.1 and Mac OS X Lion 10.7.
#
# This happens on my Macbook Air Mid-2011 Core i7. Every few hours, with
# one or (particularly) more VMs running, you will get a kernel panic.
#
# Some reading:
# https://www.virtualbox.org/ticket/9359
@joseph
joseph / gist:1098634
Created July 22, 2011 01:12
blocks_for helper
# Iterates over an array and creates a bunch of "blocks" containing the
# yielded content. Example:
#
# <% urls = [
# "http://inventivelabs.com.au",
# "http://booki.sh",
# "http://nomify.com",
# "http://rungs.com.au",
# "http://getslipcase.com"
# ] %>
<!-- Assuming you have a Monocle reader in the global 'reader' variable -->
<div onclick="reader.moveTo({ direction: -1 });">Previous page</div>
<div onclick="reader.moveTo({ direction: 1 });">Next page</div>
@joseph
joseph / gist:573248
Created September 10, 2010 07:29
Making sense of touch events on iframes in iOS 4.1
function translateTouchEvent(element, target, evt, edata) {
// IN 4.1 ONLY, if we have a touch start on the layer, and it's been
// almost no time since we had a touch end on the layer, discard the start.
// (This is the most broken thing about 4.1.)
if (
p.brokenModel_4_1 &&
!edata.frame &&
!p.touching &&
edata.start &&
p.edataPrev &&
DRAFT SPECIFICATION
# Zhook: Zip + HTML + Book.
Software that displays a Zhook file is here called a Reading System (RS).
A Zhook file is a zip file with a .zhook extension, which must contain:
* index.html (the Index)