(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.
import { Component, bundle } from 'ng-forward'; | |
import { ComponentA } from './component-a'; | |
import { ComponentB } from './component-b'; | |
@Component({ | |
selector: 'app', | |
directives: [ ComponentA, ComponentB ] | |
}) | |
export class App { } |
var _ = require('lodash'); | |
var path = require('path'); | |
var moment = require('moment'); | |
var request = require('superagent'); | |
var excel = require('elxml'); | |
var conf = require('../../configure'); | |
var upstream = conf.upstream; | |
var baseuri = 'http://' + upstream.host + ':' + upstream.port; |
(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.
/** | |
* Implementation example of writable response bodies. | |
* Based on the draft of the Streams API (19 March 2014) | |
* https://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm | |
* Design document for response body reading/writing: | |
* https://docs.google.com/document/d/1iE6M-YSmPtMOsec7pR-ILWveQie8JQQXTm15JKEcUT8 | |
*/ | |
/* globals chrome, ByteStream, URL, XMLHttpRequest */ | |
'use strict'; |
/* | |
* Copyright 2014 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
Look at the README. |
document.addEventListener('WeixinJSBridgeReady', function(){ | |
//如果执行到这块的代码,就说明是在微信内部浏览器内打开的. | |
alert('当前页面在微信内嵌浏览器中打开!'); | |
}); |
I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.
From Require.js - Why AMD:
The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"
I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.
var mongo = require('mongoskin'); | |
var db = mongo.db('127.0.0.1:27017/test'); | |
// create index: | |
// key, unique, callback | |
db.collection('user').ensureIndex([['name', 1]], true, function(err, replies){}); | |
// bind method: db.user ===> db.collection('user') | |
db.bind('user'); |