Skip to content

Instantly share code, notes, and snippets.

View hzhangxyz's full-sized avatar

Hao Zhang(张浩) hzhangxyz

View GitHub Profile
@hzhangxyz
hzhangxyz / index.html
Last active March 31, 2017 13:38
HTML5 element
<script>
window.onload = function(){
var Name = document.registerElement("name-div",{
prototype: Object.create(HTMLDivElement.prototype,{
createdCallback: {
value: function(){
this.shadow = this.createShadowRoot();
}
},
attributeChangedCallback: {
@hzhangxyz
hzhangxyz / pool.js
Last active January 23, 2018 08:19
learn js Promise
pool = []
pool.push([1,1])
plus = async (a,b)=>await a+ await b
time = async (a)=>2* await a
main = async() =>{
for(var i=1;i<=10;i++){
pool.push([
plus(pool[i-1][0], pool[i-1][1]),
@hzhangxyz
hzhangxyz / user.js
Last active March 31, 2017 07:17
mis.USTC.helper
// ==UserScript==
// @name mis.USTC Helper
// @namespace mis.ustc.edu.cn
// @version 0.0
// @description delete login information for USTC mis automatically
// @author H.Zhang
// @match http://mis.teach.ustc.edu.cn/
// @match http://mis.teach.ustc.edu.cn/index.jsp
// @grant none
// ==/UserScript==