Skip to content

Instantly share code, notes, and snippets.

View 生成随机字符串
const randomString = () =>
Math.random().toString(36).substring(7).split('').join('.')
@JQChan
JQChan / parenthesesChecker.ts
Last active Mar 25, 2021
栈的应用:实现平衡括号算法
View parenthesesChecker.ts
import { Stack } from './Stack';
/** 平衡括号算法 */
function parenthesesChecker(symbols: string) {
const stack = new Stack<string>();
const opens = '([{';
const closers = ')]}';
let balanced = true;
let index = 0;
let symbol;
@JQChan
JQChan / object-watch.js
Created Feb 18, 2019 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
View object-watch.js
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@JQChan
JQChan / output-after-css-change.md
Created Aug 30, 2016 — forked from necolas/output-after-css-change.md
Webpack hashing and file-loader bugs
View output-after-css-change.md

about/index.css was changed. color: black -> color: blue.

Issues with output:

  • Same hash
  • Same chunkhash (messes with cache invalidation of CSS)
  • Another different publicPath coming from file-loader in the extracted CSS.

Webpack