This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Backbone.Events.one = function (events, callback, context) { | |
var self = this; | |
function wrapper() { | |
self.off(events, wrapper, context); | |
callback.apply(this, arguments); | |
} | |
this.on(events, wrapper, context); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Sane Modal</title> | |
<meta name="viewport" content="width=device-width"> | |
<link rel="stylesheet" href="positioned.css"> | |
</head><body> | |
<div id="base-layer"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Sane Modal</title> | |
<meta name="viewport" content="width=device-width"> | |
</head><body> | |
<!-- All "normal" content goes in the base layer --> | |
<div id="base-layer"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Typical Prototype composure in JS; This is the classical way of creating and | |
// using objects in JS. | |
// | |
// "Super" or "Parent" object prototype | |
function Cat(color) { | |
this.color = color; | |
this.saying = 'meowwww'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
{# <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> #} | |
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]--> | |
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]--> | |
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]--> | |
<!--[if IE 9 ]> <html class="no-js ie9" lang="en"> <![endif]--> | |
<!--[if !(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<style>/* This works just as well in a stylesheet, of course */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Call this script with a http URL as the single argument: | |
// node test_request.js http://www.google.com | |
var http = require('http'); | |
var url = require('url'); | |
parsed = url.parse(process.argv[2]); | |
var opts = { | |
port: 80, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a factory function which creates a middleware handler | |
# for serving static files. | |
# | |
# We have to use staticServer.serveFile() instead of .serve() because | |
# we are dynamically rewriting the file path based on the name of the | |
# application asking for the file. | |
resourceHandler = (opts) -> | |
staticServer = new static.Server(STATIC_PATH) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
# Kris Walker <[email protected]> | |
# Copyright 2011 Licensed under the MIT License http://opensource.org/licenses/mit-license.php | |
# | |
# Namespaced and Stateful events | |
# * Event names are namespaced | |
# * Event name specificity is separated by a dot "." | |
# * Event names get more specific from left to right. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* DAG node | |
* -------- | |
*/ | |
var tabbar = | |
[ | |
{ name: "tabname", | |
title: "Title", | |
thumbnail: "Icon", | |
resource_type: "list, movie, image, ...", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<style type="text/css"> | |
body { | |
font-size: 18px; | |
background: #000; | |
color: #fff; | |
} | |
#container { | |
width: 600px; |