function daySpan (date1, date2) {
// your code
}
This is a nice program to train your front-end web development skill by several small projects. Each project focuses on different key points. The projects will be ordered by its skill level. They will be harder and harder to finish. After each project dues, we will have an online review on your code.
Here are some basic requirements:
- Stupid question will not be answered. Google it yourself.
- You must push all your code to a github repository called
web-learning
. - Every commit must not contain too much changes to let me easily check how you have done these works.
- Commit messages must be clear and detailed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<view class="comp"> | |
<slot></slot> | |
</view> | |
</template> | |
<script> | |
import wepy from 'wepy' | |
export default class Comp extends wepy.component {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 实现一个方法 parallel(tasks, concurrency),让 tasks 并发执行(并控制并发数为 concurrency) | |
// 其中 tasks 为一个数组,每一个元素都是一个方法返回一个 promise | |
// 当所有 tasks 执行完成时,resolve 一个数组保存所有的结果 | |
// 当任意一个 task 执行失败时,reject 这个错误 | |
const assert = require('assert') | |
function task (input) { | |
return () => new Promise(resolve => { | |
setTimeout(() => resolve(input), 1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 实现一个方法 parallel(tasks, concurrency),让 tasks 并发执行(并控制并发数为 concurrency) | |
// 其中 tasks 为一个数组,每一个元素都是一个方法返回一个 promise | |
// 当所有 tasks 执行完成时,resolve 一个数组保存所有的结果 | |
// 当任意一个 task 执行失败时,reject 这个错误 | |
// 运行方法: | |
// $ tsc parallel.ts --target esnext && mocha parallel | |
declare const require | |
declare const describe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 触宝输入法快捷输入配置文件制作器 | |
// 文件位置: /data/data/com.cootek.smartinputv5/files/v5701/shortcut.lst | |
const fs = require('fs') | |
function read() { | |
const data = fs.readFileSync('/tmp/shortcut.lst') | |
let offset = 4 | |
const count = data.readUInt32LE() |