Meteor 是一個 full-stack 的開發框架 (或者該說是平台),它可以利用一種語言 (JavaScript) 來輕鬆完成前後端的開發。是目前前景看好的選擇。
本階段的目標是:
- 了解 Meteor 是什麼樣的平台,基本架構,可以做到什麼樣的事情 (2.5 hr)
- 能夠自己獨立完成一個 Meteor 的 ToDo App (不斷的練習一樣的 App,直到完全熟悉,+10 hr)
這階段大約花 10-20 hr,可以利用一個週末的兩天時間,或是一個禮拜的晚上來完成。
var passport = module.parent.require('passport'), | |
passportLocal = module.parent.require('passport-local').Strategy, | |
plugin = {}; | |
plugin.login = function() { | |
winston.info('[login] Registering new local login strategy'); | |
passport.use(new passportLocal({passReqToCallback: true}, plugin.continueLogin)); | |
}; | |
plugin.continueLogin = function(req, username, password, next) { |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
// Copyright 2012 Square, Inc. | |
package com.squareup.widgets; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.util.AttributeSet; | |
import android.widget.ImageView; | |
/** Maintains an aspect ratio based on either width or height. Disabled by default. */ | |
public class AspectRatioImageView extends ImageView { |