Skip to content

Instantly share code, notes, and snippets.

@JQChan
JQChan / 生成随机字符串
Created September 15, 2021 02:35
RandomString
const randomString = () =>
Math.random().toString(36).substring(7).split('').join('.')
@JQChan
JQChan / parenthesesChecker.ts
Last active March 25, 2021 08:04
栈的应用:实现平衡括号算法
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 February 18, 2019 03:27 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
/*
* 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 August 30, 2016 07:03 — forked from necolas/output-after-css-change.md
Webpack hashing and file-loader bugs

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