This file contains 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
# Depends on working pdftk, gm (GraphicsMagick), and pdftotext (Poppler) commands. | |
# Splits a pdf into batches of N pages, creates their thumbnails and icons, | |
# as specified in the Job options, gets the text for every page, and merges | |
# it all back into a tar archive for convenient download. | |
# | |
# See <tt>examples/process_pdfs_example.rb</tt> for more information. | |
class ProcessPdfs < CloudCrowd::Action | |
# Split up a large pdf into single-page pdfs. Batch them into 'batch_size' | |
# chunks for processing. The double pdftk shuffle fixes the document xrefs. |
This file contains 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
/* MultiFile - A JavaScript library to load multiple files from | |
tar archives and json_packed files (see http://gist.github.com/407595) | |
Example: Loading multiple images from a tarball. | |
MultiFile.load('images.tar', function(xhr) { | |
this.files.forEach(function(f) { | |
var e = document.createElement('div'); | |
document.body.appendChild(e); | |
var p = document.createElement('p'); |
This file contains 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
TarGZ = function(){}; | |
// Load and parse archive, calls onload after loading all files. | |
TarGZ.load = function(url, onload, onstream, onerror) { | |
var o = new TarGZ(); | |
o.onload = onload; | |
o.onerror = onerror; | |
o.onstream = onstream; | |
o.load(url); | |
return o; |
This file contains 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
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
This file contains 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
// Note that this uses my Pub/Sub implementation, which is slightly different than | |
// phiggins' in that jQuery custom events are used, and as such the first event handler | |
// argument passed is the event object. | |
// | |
// jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery | |
// https://gist.github.com/661855 | |
// The "traditional" way. |
This file contains 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
function Track(src, spriteLength, audioLead) { | |
var track = this, | |
audio = document.createElement('audio'); | |
audio.src = src; | |
audio.autobuffer = true; | |
audio.load(); | |
audio.muted = true; // makes no difference on iOS :( | |
/* This is the magic. Since we can't preload, and loading requires a user's | |
input. So we bind a touch event to the body, and fingers crossed, the |
This file contains 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
if (typeof require == 'undefined') { | |
var exports = window, | |
server = false; | |
} else { | |
var Backbone = require('./backbone'), | |
_ = require('underscore')._, | |
server = true; | |
} | |
exports.TeamModel = Backbone.Model.extend() |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>IndexDB Demo - Version 1.1</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<meta name="author" content="Ido Green"/> | |
</head> | |
<style> | |
#footer { | |
background-color: yellowgreen; |
This file contains 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
-module(riak_zmq). | |
-export([postcommit_publish/1, get_zmq_publisher/0, zmq_publisher/0, zmq_publisher/1]). | |
postcommit_publish(RObj) -> | |
Body = riak_object:get_value(RObj), | |
{ok, Pid} = get_zmq_publisher(), | |
Pid ! {send, Body}. | |
get_zmq_publisher() -> |
This file contains 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
/* | |
* Normalized hide address bar for iOS & Android | |
* (c) Scott Jehl, scottjehl.com | |
* MIT License | |
*/ | |
(function( win ){ | |
var doc = win.document; | |
// If there's a hash, or addEventListener is undefined, stop here | |
if( !location.hash && win.addEventListener ){ |
OlderNewer