为了更方便阅读 acorn 的代码,我把 acorn 的 parser 都合并到 state.js 内了:
https://github.com/kindy/acorn/blob/vscode-happy/acorn/src/state.js
# vim:fdm=manual:sw=2:ts=2:et:ft=gitconfig: | |
[alias] | |
b = branch | |
ba = branch -a | |
c = commit | |
cf = config | |
ci = commit | |
co = checkout | |
dc = svn dcommit |
为了更方便阅读 acorn 的代码,我把 acorn 的 parser 都合并到 state.js 内了:
https://github.com/kindy/acorn/blob/vscode-happy/acorn/src/state.js
-- es5 --
declare var NaN
declare var Infinity
declare function eval(x
declare function parseInt(s
declare function parseFloat(string
declare function isNaN(number
declare function isFinite(number
/* eslint no-param-reassign: 0 */ | |
/** | |
* JavaScript implementation of W3 DOM4 TreeWalker interface. | |
* | |
* See also: | |
* - https://dom.spec.whatwg.org/#interface-treewalker | |
* | |
* Attributes like "read-only" and "private" are ignored in this implementation | |
* due to ECMAScript 3 (as opposed to ES5) not supporting creation of such properties. |
For excessively paranoid client authentication.
Organization & Common Name: Some human identifier for this server CA.
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
// 此处所列函数只是框架,实际使用仍需要调整和修正 | |
// 提供的是一个思路 | |
// 替换函数是同步的 | |
function replSync(txt) { | |
let pick = (s, e) => txt.substring(s, e); | |
const re = /\w/g; | |
const buf = []; | |
let lastIdx = 0; |
一般文件上传都会使用 Form 形式, 其实如果只是为了做一个简单的文件服务的话,那么可以简化许多。
Nginx 默认提供了文件访问服务,使用 autoindex 可以提供文件list 功能; 对于文件上传,使用 WebDAV模块可以极大简化上传的实现及用法。
title | tags | authors | |||||
---|---|---|---|---|---|---|---|
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily |
|
|
class Vector { | |
constructor(public x: number, public y: number, public z: number) { } | |
static times(k: number, v: Vector) { | |
return new Vector(k * v.x, k * v.y, k * v.z); | |
} | |
static minus(v1: Vector, v2: Vector) { | |
return new Vector(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z); |