Update node using nvm
nvm install 6.3
nvm alias default 6.3
nvm use 6.3
Install and Update pm2
npm install pm2@latest -g ; pm2 update
package com.gd.ashylin.crawler.service; | |
import com.gd.ashylin.crawler.CrawlerResult; | |
import com.gd.ashylin.crawler.CrawlerResults; | |
import com.gd.ashylin.crawler.CrawlerStatus; | |
import com.gd.ashylin.crawler.Sorting; | |
import com.gd.ashylin.crawler.logic.Crawler; | |
import java.util.Collections; | |
import java.util.HashMap; |
parameters: | |
mad.crawler.client.config: | |
user_agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:35.0) Gecko/20100101 Firefox/35.0 FirePHP/0.7.4" | |
base_url: %crawler.base.url% | |
mad.crawler.config: | |
crawler_sleep: 5; | |
item_sleep: 0.5 | |
mad.crawler.main_url_list: [ %crawler.base.url% ] |
/** | |
* Simple authentication and authorization example with passport, node_acl, | |
* MongoDB and expressjs | |
* | |
* The example shown here uses local userdata and sessions to remember a | |
* logged in user. Roles are persistent all the way and applied to user | |
* after logging in. | |
* | |
* Usage: | |
* 1. Start this as server |
Translated from https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/, author: Mark Erikson (from Redux team)
Bài viết cung cấp chi tiết về cách mà React render hoạt động, và việc sử dụng Context và Redux ảnh hưởng thế nào tới quá trình render của React.
Rendering is the process of React asking your components to describe what they want their section of the UI to look like, now, based on the current combination of props and state.
Not all random values are created equal - for security-related code, you need a specific kind of random value.
A summary of this article, if you don't want to read the entire thing:
Math.random()
. There are extremely few cases where Math.random()
is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.crypto.getRandomBytes
directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.uuid
, specifically the uuid.v4()
method. Avoid node-uuid
- it's not the same package, and doesn't produce reliably secure random values.random-number-csprng
.You should seriously consider reading the entire article, though - it's
npm install --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-config-standard eslint-plugin-import eslint-plugin-node eslint-plugin-prettier eslint-plugin-promise eslint-plugin-react eslint-plugin-standard prettier
# OR
yarn add -D @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-config-standard eslint-plugin-import eslint-plugin-node eslint-plugin-prettier eslint-plugin-promise eslint-plugin-react eslint-plugin-standard prettier
// This is the simplest possible approach - use a custom module to wrap a single, pre-configured | |
// mail transport instance and then use sinon.js to stub out that modules sendmail() | |
// This approach has its limitations, but it is still better than having 'if(NODE_ENV === 'test')' | |
// all over the code base. | |
// -- app/sendmail.js -- | |
var nodemailer = require('nodemailer'); | |
var config = require('config').email; |