Skip to content

Instantly share code, notes, and snippets.

@tantaman
tantaman / IndexedDB-storing-and-retrieving-files.js
Last active April 4, 2021 22:10 — forked from robnyman/IndexedDB-storing-and-retrieving-files.js
Download an image, save it to IndexedDB, read it out, display the image via createObjectURL - works in Chrome and Firefox. Based on https://hacks.mozilla.org/2012/02/storing-images-and-files-in-indexeddb/ but with fixes made for Chrome.
(function () {
// IndexedDB
function BrowserType() {
var n = navigator.appName;
var ua = navigator.userAgent;
var tem;
var m = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
if (m && (tem = ua.match(/version\/([\.\d]+)/i)) != null) m[2] = tem[1];
m = m ? [m[1], m[2]] : [n, navigator.appVersion, '-?'];
#!/usr/bin/env ruby
# This Ruby script will extract data from a Basecamp "backup" XML file and import
# it into Redmine.
#
# You must install the Nokogiri gem, which is an XML parser: sudo gem install nokogiri
#
# This script is a "code generator", in that it writes a new Ruby script to STDOUT.
# This script contains invocations of Redmine's ActiveRecord models. The resulting
# "import script" can be edited before being executed, if desired.
@tantaman
tantaman / example_usage.markdown
Created May 22, 2012 20:27 — forked from lwe/example_usage.markdown
iPhoto-like preview batches (Video in action: http://www.vimeo.com/6639381)

in action: http://www.vimeo.com/6639381

javascript:

var pp = "/images/test/images_";
var images_p1 = [ pp + '1.jpg', pp + '2.jpg', pp + '3.jpg', pp + '4.jpg', pp + '5.jpg' ];
var images_p2 = [ pp + '6.jpg', pp + '7.jpg', pp + '8.jpg', pp + '9.jpg', pp + '10.jpg' ];

$('.preview').slideview(function(e) { return e.id == "p1" ? images_p1 : images_p2; }, { size: 75 });
<!doctype html>
<html>
<head>
<title>Three.js : WebGL Canvas Texture Text Example</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
body {
@tantaman
tantaman / Cakefile
Created January 22, 2012 14:48 — forked from mattmccray/Cakefile
Cakefile for compiling Coffee and LESS files, optionally compressing them with YUIC
###
Web Toolkit v0.4 (by M@ McCray)
http://gist.github.com/515035
NOTE: This is meant to be used as a Cakefile (Coffee's RAKE equivalent).
###
puts = require("util").puts