Skip to content

Instantly share code, notes, and snippets.

View rwaldron's full-sized avatar

Rick Waldron rwaldron

  • Boston, MA
View GitHub Profile
(function($canvas) {
var
// STORE DEFAULT CELL ATTRS
cellAttrs = {
fill: "#E0E4CD",
stroke: "#000",
"stroke-width": 2
},
// SET UP CELL ARRAY
$cells = [],
Array
+ concat
+ every
+ filter
+ forEach
+ indexOf
+ join
+ lastIndexOf
+ length
+ map
/*
Usages:
$(selector).classList() //returns an array of classnames
$(selector).classList('newclass') //replaces the current element's classes
$(selector).classList(['new', 'class', 'names']) //replaces the current element's classes
*/
jQuery.fn.extend({
classList: function( value ) {
if( value ){
<!DOCTYPE html>
<html>
<head>
<title>jquery.classes.js</title>
<script src="jquery-1.4.2.js"></script>
<script src="jquery.classes.js"></script>
</head>
<body>
<p class="foo bar baz">classes: foo, bar, baz</p>
import urllib
import optparse
import os.path
import pickle
def truncate(message,limit):
if len(message) > limit:
# break off at 137 chars and concat elipsis
return message[:(limit-3)] + "..."
.mouse{
position: absolute;
background-image: url('../images/cursor.png');
width: 15px;
height: 22px;
z-index: 100;
}
Burst({
'arbitrary-timeline-name' : {
start: 0,
frames: 100,
ratio: 1,
loop: false,
finish: function () {},
tracks: {
<!DOCTYPE html>
<html>
<head>
<title>Badges</title>
</head>
<body>
<script src="badge.js?type=jedi"></script>
<script src="badge.js?type=ninja"></script>
<script src="caret.js"></script>
$.mines.detonate('/fuse/c', ['message']);
$.mines.detonate([
{
key: '/fuse/a',
args: ['message from fuse a', { foo: 'bar' }]
},
{
key: '/fuse/b',