This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.
— Erik
var cartModule = (function(postal, $){ | |
var cartId = 0, | |
cartTemplate = "#cart-tmpl", | |
cartItemTemplate = "#cart-item-tmpl", | |
cartChildrenSelector = "#cart-list", | |
wireUpCart = function(cart) { | |
postal.subscribe("cart", "init", _.bind(cart.init,cart)); | |
postal.subscribe("cart", "item.add", function(item) { | |
var member = cart.id + "-" + item.id; |
#Four Ways To Do Pub/Sub With jQuery and jQuery UI (in the future)
Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.
(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)
##Option 1: Using jQuery 1.7's $.Callbacks() feature:
<!-- Annotated javascript available at http://enja.org/code/tuts/d3/bar --> | |
<!-- Code walkthrough screencast available at --> | |
<html> | |
<head> | |
<title>Enjalot's Bar</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.1.3"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?2.1.3"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.1.3"></script> | |
<style type="text/css"> | |
.bar rect |
# | |
# CoffeeScript for http://dealloc.me/demos/crime/2011.html | |
# Copyright (c) 2011 Justin Palmer <http://github.com/Caged> | |
# LICENSE: http://www.opensource.org/licenses/mit-license.php | |
$ -> | |
hash = document.location.hash | |
year = if hash then hash.replace('#', '') else 2011 | |
[pt,pl,pb,pr] = [35, 20, 20, 20] | |
w = (900 - (pl + pr)) / 2 | |
h = w |
// Return an object who's members match a reference array of keys | |
// reference=["b","c","f","r"]; | |
// obj={"a":1, "b":2, "c":3, "d":4, "r":18}; | |
// _.filterObj(obj, reference) | |
// => { b : 2, c : 3, r : 18} | |
_.mixin( { | |
filterObj : function( obj, reference ) { | |
if ( reference && typeof reference == 'object' ) { reference=_.keys( reference ); } | |
var intersect = _.intersect(reference, _.keys(obj)), retObj= {}; | |
_.map( intersect, function( el) { retObj[el]=obj[el];}) |
====================================================== | |
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10 | |
====================================================== | |
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu | |
8.10. The article is targeted at a production environment, but keep in mind | |
this is a more generalized environment. You may have different requirements, | |
but this article should at least provide the stepping stones. | |
The article will use distribution packages where nesscary. As of 8.10 the |