Skip to content

Instantly share code, notes, and snippets.

Carlos Araya caraya

Block or report user

Report or block caraya

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
View ebook-package.json
"spine": [
"idref": "cover"
"idref": "titlepage"
"idref": "about"
View index.html
<!doctype html>
<html lang="en">
<meta charset="UTF-8">
<div class="viewport"></div>
<script src="//"></script>
<script src="//"></script>

The only requirements for popup footnotes in iBooks are:

  • Ebook has to be an EPUB3
  • epub:type "noteref" and "footnote"

So you can link to a totally separate document, as you normally would for endnotes, but include the attributes so the link behaves differently in iBooks, instead triggering the popup.

Original reference link would look something like this (in a file called ch001.html):


View ReassertParaStyles
//originally published here:
//rewritten to be CC compliant
//DESCRIPTION: Visit all paragraphs in document and reassert paragraph styles
myStyles = app.activeDocument.allParagraphStyles;
app.findTextPreferences = null;
app.changeTextPreferences = null;
for (var n = 1; myStyles.length > n; n++){
app.findTextPreferences.appliedParagraphStyle = myStyles[n];
app.changeTextPreferences.appliedParagraphStyle = myStyles[n];
View high-dpi-media.css
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
View data-markdown.user.js
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <>
// @link
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
(function boom(){
caraya /
Created Sep 27, 2014
generator for package.opf file in epub3 books
#!/usr/bin/env python
import mimetypes
import glob
import os
import os.path
# Initialize the mimetypes database
# Create the package.opf file
package = open('package.opf', 'w')
caraya / CSSOM
Last active Aug 29, 2015 — forked from paceaux/CSSOM
window.analyzer = {
init: function (object, id) {
this.functions.addCaption("Analysis of the stylesheets");
data: {},
helpers: {
wrapper: function (id) {
View rAF.js
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
View bootstrap-config.json
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
You can’t perform that action at this time.