Skip to content

Instantly share code, notes, and snippets.

@mcongrove
mcongrove / HTML5_Audio_Duration.html
Created April 20, 2011 06:36
Retrieve the duration of an HTML5 audio element.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>HTML5 Audio Duration</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
var audio, duration;
window.onload = function() {
var element = document.createElement("audio");
@mcongrove
mcongrove / RedFlare.md
Created April 14, 2011 21:10
A description of the RedFlare service.

What is RedFlare?

RedFlare is an automated emergency contact notification system. It automatically contacts the people who love you in the event that you didn't get home when you should have.

Why do I need it?

Say for instance that you just moved to Boston, MA, and you want to go exploring the mountains just outside the city. Unfortunately you don't have many friends in town, so no one will notice if you've gone missing for quite some time. If the unthinkable happens and you've been pinned under a rock, broken an ankle or just gotten lost in an area without cell reception, you could be in serious trouble.

@mcongrove
mcongrove / TiFtp.js
Created April 11, 2011 22:02
An FTP wrapper library for Titanium Mobile.
var TiFtp = {
config: {
host: null,
port: 21,
path: null,
user: null,
password: null
},
init: function(_host, _path, _user, _password) {
if(!_host || !_path || !_user || !_password) {
@mcongrove
mcongrove / TiLoad.js
Created April 6, 2011 17:12
A loading screen that can be shown and hidden from anywhere within an application
var TiLoad = {
visible: false,
init: function(_properties) {
var options;
if(_properties && _properties.rotate) {
options = {
orientationModes: [
Titanium.UI.LANDSCAPE_LEFT,
Titanium.UI.LANDSCAPE_RIGHT,
@mcongrove
mcongrove / TiDrop.js
Created April 1, 2011 22:13
A quick and simple example of how to do drag+drop in Titanium
var TiDrop = {
touching: false,
position: {
elementYStart: 0,
elementXStart: 0,
yStart: 0,
xStart: 0,
yCurrent: 0,
xCurrent: 0
},