(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| (function() { | |
| 'use strict'; | |
| var cacheBust = 0, | |
| hashInterval, | |
| lastHash; | |
| this.xd = { | |
| postMessage: function(message, targetOrigin, otherWindow) { | |
| if (!targetOrigin) |
| var app = angular.module('app', ['ngResource']); | |
| app.config(function($locationProvider, $routeProvider) { | |
| // $locationProvider.html5Mode(true); | |
| $routeProvider | |
| .when('/', { templateUrl: 'partials/index', controller: 'ctrl' }) | |
| .when('/about', { templateUrl: 'partials/about', controller: 'ctrl' }) | |
| .otherwise({redirectTo:'/'}); | |
| }); |
| var express = require('express'), | |
| passport = require('passport'), | |
| TwitterStrategy = require('passport-twitter').Strategy, | |
| ensureLoggedIn = require('connect-ensure-login').ensureLoggedIn, | |
| app = express(); | |
| app.use(express.static(__dirname + '/public')); | |
| app.use(express.cookieParser()); | |
| app.use(express.session({ secret: 'keyboard cat' })); | |
| app.use(passport.initialize()); |
| /* The API controller | |
| Exports 3 methods: | |
| * post - Creates a new thread | |
| * list - Returns a list of threads | |
| * show - Displays a thread and its posts | |
| */ | |
| var Thread = require('../models/thread.js'); | |
| var Post = require('../models/post.js'); |