a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
Your mama's so fat that all her shell commands run in verbose mode. - @HenrikJoreteg | |
Your momma's so fat she returns an http 413 error: Request entity too large! - @boringgeek |
var Router = require('ampersand-router'); | |
var app = require('ampersand-app'); | |
function auth(authLevel, fn) { | |
return function () { | |
if (authLevel === 'required' && !app.me.loggedIn) { | |
this.redirectTo('/login'); | |
return; | |
} |
var View = Backbone.View.extend({ | |
initialize: function () { | |
this.handleBindings(); | |
}, | |
contentBindings: { | |
title: '.title' | |
}, | |
classBindings: { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Some single page app</title> | |
<style> | |
/* | |
Here's the magic, we take the unselectable attribute and make it more powerful | |
in browsers that support it see here for more: | |
http://help.dottoro.com/lcrlukea.php#-webkit-user-select | |
*/ |
""" | |
Straight Include template tag by @HenrikJoreteg | |
Django templates don't give us any way to escape template tags. | |
So if you ever need to include client side templates for ICanHaz.js (or anything else that | |
may confuse django's templating engine) You can is this little snippet. | |
Just use it as you would a normal {% include %} tag. It just won't process the included text. |
if (typeof require == 'undefined') { | |
var exports = window, | |
server = false; | |
} else { | |
var Backbone = require('./backbone'), | |
_ = require('underscore')._, | |
server = true; | |
} | |
exports.TeamModel = Backbone.Model.extend() |
=text_shadow($color, $x, $y, $blur) | |
:text-shadow = $color $x $y #{$blur}px | |
=box_shadow($color, $x, $y, $blur) | |
:-webkit-box-shadow = $color $x $y #{$blur}px | |
:-moz-box-shadow = $color $x $y #{$blur}px | |
:box-shadow = $color $x $y #{$blur}px | |
=inner_shadow($color, $x, $y, $blur) | |
:box-shadow = inset $color $x $y #{$blur}px |
var fermata = require('fermata'), | |
uuid = require('node-uuid'); | |
var apiKey = 'YOUR_API_KEY'; // should probably be imported from an external keys file | |
var site = fermata.api({url: 'https://api.postageapp.com/v.1.0'}); | |
exports.send = function (details, cb) { | |
site['send_message.json'].post(details, cb); | |
}; |
a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
/* | |
Building a module this way allows you to do this on the client: | |
<script src="underscore.js"></script> | |
<script src="myutils.js"></script> | |
Then use it in your code as children of '_' without polluting your global namespace. | |
_.myFunction(); |