This is a temporary solution. Might change in the near future, this depends on how create-react-app will implement testing.
create-react-app quick-test-example
cd quick-test-example
npm run eject
# first: | |
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
# go to /usr/local/lib and delete any node and node_modules | |
cd /usr/local/lib | |
sudo rm -rf node* |
getTimeByYearAndMonth = () => { | |
// month start with 0 | |
// 获取某日开始时间、结束时间 | |
const firstTimeOfDay = new Date(year, month, date); | |
const lastTimeOfDay = new Date(new Date(year, month, date + 1) - 1); | |
// 获取某月开始第一天时间、月最后一天时间 | |
const firstDayOfMonth = new Date(year, month, 1); | |
const lastDayOfMonth = new Date(new Date(year, month + 1, 1) - 1); |
let a = ['a', 'b', 'c']; | |
let b = ['c', 'a', 'd']; | |
let c = ['f', 'g', 'h']; | |
console.log(a, b, a.some(v => b.includes(v))); | |
console.log(a, b, a.some(v => b.indexOf(v) >= 0); | |
console.log(a, c, a.some(v => b[b.indexOf(v)] === v)); |
@rectangle-color: green; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
body { | |
background: black; | |
} |
function calendar() { | |
const {year, month, current} = this.state | |
console.log(current) | |
const LastDate = this.getLastDateOfMonth(year, month) | |
const array = [] | |
const preMonthDiffDay = this.getFirstDateOfMonth(year, month).getDay() | |
const selectedDate = `${current.getFullYear()}-${current.getMonth() + 1}-${current.getDate()}` |
var debug = process.env.NODE_ENV !== "production"; | |
var webpack = require('webpack'); | |
module.exports = { | |
context: __dirname, | |
devtool: debug ? "inline-sourcemap" : null, | |
entry: "./js/scripts.js", | |
output: { | |
path: __dirname + "/js", | |
filename: "scripts.min.js" |
Source: http://chris.beams.io/posts/git-commit/#seven-rules
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
charset = utf-8 | |
end_of_line = lf | |
insert_final_newline = true | |
trim_trailing_whitespace = true | |
max_line_length = 100 |