Skip to content

Instantly share code, notes, and snippets.

View rwaldron's full-sized avatar

Rick Waldron rwaldron

  • Boston, MA
View GitHub Profile
/*!
* JavaScript whatevCache - v0.2pre - 12/30/2010
* http://benalman.com/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
// whatevCache.set( key, value [, ttl ] );
@rwaldron
rwaldron / gist:778480
Created January 13, 2011 19:58 — forked from k33g/gist:778460
function Human(){
var that = this;
var name="John Doe";
that.getName=function(){return name;}
that.setName=function(value){name=value;}
return that;
}
function Man(){
function domReady(callback) {
var domLoaded;
var called;
var onReadyStateChange = function () {
if (document.readyState == 'complete') {
domLoaded();
}
};
<!DOCTYPE html>
<html>
<head>
<title>Dojo x-domain Skeleton</title>
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js"></script>
<script>
// the superclass
dojo.declare("Foo", null, {
bar:function(){
/*!
* jQuery htmlDoc "fixer" - v0.2pre - 12/15/2010
* http://benalman.com/projects/jquery-misc-plugins/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($){
var supportedMimeTypes = ['video/mp4', 'video/x-ms-wmv'];
var supportedVideoExtensions = ['.mp4', '.wmv', '.mp4v', '.m4v'];
var getSupportedMediaSource = function(videoElement)
{
// If the video element source is supported, then we replace the tag.
if (videoElement.src
&& isWMPSupported(videoElement))
{
var supportedMimeTypes = ['video/mp4', 'video/x-ms-wmv'];
var supportedVideoExtensions = ['.mp4', '.wmv', '.mp4v', '.m4v'];
var getSupportedMediaSource = function(videoElement)
{
// If the video element source is supported, then we replace the tag.
if (videoElement.src
&& isWMPSupported(videoElement))
{
<?php
echo "Prepping CSS and JS for deploy...\n";
$css_files['app'] = array('reset', '960', 'screen', 'jquery.tagsinput', 'jquery.autocomplete', 'tipsy', 'prettify');
//$css_files['splash'] = array('reset', 'splash');
//$css_files['iphone'] = array('reset', 'screen', 'iphone');
$js_files['app'] = array('jquery.autocomplete.min', 'jquery.tagsinput', 'jquery.scrollTo-1.4.2-min', 'forrst',
'jquery.tipsy', 'jquery.autoresize.min', 'prettify',
; Just drop this in /etc/couchdb/local.d/ and then
; start CouchDB normally.
; Here couch_node can be anything as long as it's uniq.
[os_daemons]
couch_node = /Users/davisp/tmp/couch-node.js
// get the average color of two hex colors.
function avgcolor(color1,color2){
var avg = function(a,b){ return (a+b)/2; },
t16 = function(c){ return parseInt((''+c).replace('#',''),16) },
hex = function(c){ return (c>>0).toString(16) },
hex1 = t16(color1),
hex2 = t16(color2),
r = function(hex){ return hex >> 16 & 0xFF},
g = function(hex){ return hex >> 8 & 0xFF},
b = function(hex){ return hex & 0xFF},