Skip to content

Instantly share code, notes, and snippets.

View zswang's full-sized avatar

王集鹄 zswang

View GitHub Profile
@zswang
zswang / cloudSettings
Last active September 13, 2018 07:00
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-09-13T07:00:00.298Z","extensionVersion":"v3.1.2"}
@zswang
zswang / tag_class_count.js
Created March 15, 2018 03:07
Get the number of elements in the current page
console.log(
[...document.querySelectorAll("*")]
.map(el => el.nodeName)
.sort()
.filter((item, index, arr) => arr[index - 1] !== item).length
);
var s = new Set();
[...document.querySelectorAll("*")].forEach(el => s.add(el.nodeName));
console.log(s.size);