TLDR: Use for...of
instead of forEach()
in asynchronous code.
For legacy browsers, use for...i
or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
package com.example; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
import java.util.HashMap; | |
import java.util.Map; | |
@RestController | |
@RequestMapping("/api") |
packagingExcludes
configuration tag can be used to exclude certain files or directories from the war file.
It is important to put '/' character at the end of the directory to be excluded. If there is no such '/' character,
then the entry is interpreted as a regular file.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
(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.
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
In Gitlab 2.6 you must edit the following files in order to send messages through a Gmail account (also applicable to Google Apps accounts).
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
function htmlreplace(a, b, element) { | |
if (!element) element = document.body; | |
var nodes = element.childNodes; | |
for (var n=0; n<nodes.length; n++) { | |
// MSIE doesn't have Node | |
if (nodes[n].nodeType == 3) { | |
var r = new RegExp(a, 'gi'); | |
// MSIE8 and less doesn't have textContent | |
if (nodes[n].textContent) { |
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |