Skip to content

Instantly share code, notes, and snippets.

@tvpmb
tvpmb / events.js
Created January 24, 2012 21:06
Separating Events/Event-Methods from the View (partial code, 2 examples, one is commented out)
//events
define([
"namespace",
// Libs
"use!backbone",
// Plugins
"use!plugins/backbone.layoutmanager",
],
@tbranyen
tbranyen / config.js
Created January 16, 2012 18:23
use.js from a real app
require.config({
...
use: {
// Libraries
backbone: {
deps: ["use!underscore", "jquery"],
attach: "Backbone"
},
underscore: {
@addyosmani
addyosmani / pubsub.md
Created October 28, 2011 06:49
Four ways to do Pub/Sub with jQuery 1.7 and jQuery UI (in the future)

#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:

$.Callbacks are a multi-purpose callbacks list object which can be used as a base layer to build new functionality including simple publish/subscribe systems. We haven't yet released the API documentation for this feature just yet, but for more information on it (including lots of examples), see my post on $.Callbacks() here:

@mxriverlynn
mxriverlynn / 1-layout.html
Created June 21, 2011 03:06
render backbone views with jquery templates
<html>
<head>
<script src="jquery-1.6.1.min.js"></script>
<script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>
<script src="underscore-min.js"></script>
<script src="backbone-min.js"></script>
<script src="example.js"></script>
<style type="text/css">
fieldset {