Skip to content

Instantly share code, notes, and snippets.

/*
- get the third list item (hint: eq())
- change its color to red
- change the color of the rest of the list items to blue
- *without doing another selection*, find the div.module
and remove the class "module"
$(document).ready(function() {
var $li = $('li').eq(2);
$(document).ready(function() {
// move the slideshow up to the top
var $slideshow = $('#hero');
$slideshow.prependTo('#main');
// create the counter element
var $counter = $('<div/>')
.insertAfter($slideshow);
// get the items and figure out
$(document).ready(function() {
var $specials = $('#specials');
$specials.find('li.buttons').remove();
var cachedResponse = null;
var $details = $('<div/>').appendTo($specials);
var handleResponse = function(specials, val) {
var daySpecial = specials[val];
var starsSelected = dojo.some(this.stars, function(el) {
return (dojo.query('input', el)[0].value > 0);
});
dojo.provide('foo._Scheduler');
dojo.declare('foo._Scheduler', null, {
constructor : function() {
dojo.subscribe('/user/inactive', this, '_pause');
dojo.subscribe('/user/active', this, '_restart');
dojo.subscribe('/scheduler/clear', this, '_clear');
this.intervals = [];
this.requests = [];
dojo.provide('hitpost.layer');
dojo.require('plugd.trigger');
dojo.require('hitpost.Messaging');
dojo.require('hitpost.Forms');
dojo.require('hitpost.Search');
dojo.require('hitpost.ActivityMonitor');
dojo.require('hitpost.Auth');
dojo.provide('hitpost.Graph');
dojo.declare('hitpost.Graph', null, {
min : 0,
max : 6,
wait : 500,
constructor : function(domNode, animate) {
if (!domNode) { return; }
this.animate = animate || false;
@rmurphey
rmurphey / gist:217759
Created October 24, 2009 21:56
things i love about javascript
var foo = [ 1, 2, 3, { a : 'b' } ];
var bar = foo[foo.length-1];
bar.c = 'bar';
console.log(foo); // [ 1, 2, 3, { a : 'b', c : 'bar' } ]
/*!
* @projectDescription Slider class for iPhone web applications
*
* @author Rebecca Murphey rebecca@rebeccamurphey.com
* @license MIT http://www.opensource.org/licenses/mit-license.php
*/
var Slider = function(config) {
this.sections = config.sections;
egrep -r '(png|gif|jpg)' * | sed "s/.*url('\([^']*\).*/\1/"