Skip to content

Instantly share code, notes, and snippets.

class Home extends Backbone.Controller
actorsView: null
routes:
"": "index"
constructor: ->
super
console.log "Created a new home controller"
(function() {
window.app.views.ActorsView = Backbone.View.extend({
id: 'actorsview',
initialize: function() {
return console.log('Initialized a actors view');
}
});
}).call(this);
#class ActorsView extends Backbone.View
window.app.views.ActorsView = Backbone.View.extend
id: 'actorsview'
initialize: ->
#super
console.log 'Initialized a actors view'
#window.app.views.ActorsView = ActorsView
class ActorsView extends Backbone.View
id: 'actorsview'
constructor: ->
super
console.log 'Initialized a actors view'
window.app.views.ActorsView = ActorsView
(function() {
window.app = {};
app.controllers = {};
app.collections = {};
app.models = {};
app.views = {};
app.app = {};
jQuery(function() {
app.home = new app.controllers.Home();
return Backbone.history.start();
@marlun
marlun / app.js
Created May 19, 2011 21:06
Using stylus with Express.js
/**
* Module dependencies.
*/
var express = require('express')
, stylus = require('stylus');
var app = express.createServer();
// This must be BEFORE other app.use
$context = stream_context_create();
$result1 = stream_context_set_option($context, 'ssl', 'local_cert', $certPath);
$result2 = stream_context_set_option($context, 'ssl', 'passphrase', $certPass);
if (!$this->socket = stream_socket_client($target, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $context))
{
throw new Exception("Error connecting to $target: $errstr (code $errno)");
}
var ids = $(form).find('tr').slice(1).map(function() {
return parseInt($(this).find('td').eq(1).text());
});
var express = require('express'),
app = express.createServer(),
jam = require('./jam');
app.set('views', __dirname + '/templates');
app.set('view engine', 'html');
app.register('.html', require('ejs'));
app.use(express.static(__dirname + '/public'));
app.use(express.logger());
app.use(express.bodyParser());
describe('When doing this', function() {
it('should be true', function() {
console.log("AAAAAAAAAAAAAAAAAAAA");
expect(1).toEqual(1);
});
it('should be true', function() {
expect(1).toEqual(2);
});
});