Skip to content

Instantly share code, notes, and snippets.

@cacheleocode
cacheleocode / ibooks.js
Last active June 10, 2019 13:49
In iBookstore Asset Guide is a documented javascript library for interactivity in ebooks. After logging in, Select Deliver Your Content Module, Download the iBookstore Fixed Layout EPUB Example, Open the ePub with an editor or Unzip the ePub (I used Textwrangler). Open the JS Folder. There it is! From Textwrangler, I just copied and pasted the c…
/**
* iBooks JS Framework
* Compatibility: iBooks 1.5+
* Copyright © 2009-2011 Apple Inc. All rights reserved.
*
**/
/**
* @name iBooks
* @namespace
@cacheleocode
cacheleocode / adobe_edge_animate_sound.js
Last active August 29, 2015 13:56
add sound to compositions
// libraries
// http://www.edgedocks.com/edgecommos
// http://buzz.jaysalvat.com
// creationComplete
yepnope({
load: ["edge_includes/EdgeCommons.js","edge_includes/buzz.min.js"]
});
$(document).ready(function(){
$.ajaxSetup({
url: "/process/",
cache: false
});
$("#topbar .search input[title!=]").hint();
$("#navigation").navigation();
// compositionReady
// http://forums.adobe.com/message/5534162
var div =sym.lookupSelector("pizza");
$("body").append($(div).css("position", "fixed"));
$(document).ready(function() {
var index = $("#player").data("value");
var container = $("#playlist");
var scrollTo = $('#playlist a:nth-child(' + index + ')');
container.scrollTop(scrollTo.offset().top - container.offset().top + container.scrollTop());
});
window.onload = function() {
setTimeout(function() {
document.getElementById('Stage_bear_sym_bear').click();
}, 1000);
};
/*
* AppleWidgetController.js
* Copyright (c) 2010-2011 Apple, Inc.
* All rights reserved.
*
* Responsibility: drb
*/
//
// Class: AppleWidgetController
var JI = JI || {};
JI.getJSON = function(options){
if(options['callback'] == null){
options['callback'] = function(data){
return true;
}
}
this.cb = 'jsonp_request_' + Math.floor(Math.random()*1000);
window[this.cb] = function(data){
@cacheleocode
cacheleocode / views.py
Created November 21, 2014 21:20
automated push
# automated push
today = datetime.date.today()
magic = datetime.date(2014, 11, 01)
if today < magic:
closed = False
else:
closed = True
@cacheleocode
cacheleocode / authors.html
Created December 2, 2014 22:38
Django template that shows one author as simple HTML or multiple authors as tiles
{% if authors %}
{% if authors|length == 1 %}
{% for author in authors %}
<div class="article-author">
<h5>{% blocktrans %}Author{% endblocktrans %}</h5>
<h4><a href="{{ author.get_absolute_url }}">{% ifequal LANG 'ja' %}{{ author.display_name_ja }}{% else %}{{ author.display_name_en }}{% endifequal %}</a></h4>
<a href="{{ author.get_absolute_url }}"><img src="{% thumbnail author.image 120x180 upscale autocrop crop=",0" %}" alt="" class="thumbnail" /></a>