This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let currentCaller = null; | |
class FakeObservable { | |
constructor() { | |
this._value = null; | |
this._callers = new Set(); | |
} | |
set(val) { | |
this._value = val; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @decorator | |
* Attach events to DOM element | |
* | |
* @param {Element|Function} elemOrFunc: DOM Element, or a function returns element | |
* @param {String} events: a list events separated with ',' | |
* | |
* Usage: | |
* @attachEvents(window, 'click') | |
* handleWindowClick(evt) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const net = require('net'); | |
const url = require('url'); | |
const IP = '211.161.244.70'; | |
const hosts = { | |
'p[1-4].music.126.net': 'cloudedge.chinanetcenter.com', | |
'm10.music.126.net': 'ws.acgvideo.com', | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Nyanaba | |
// @namespace https://manaba.kic.kagoshima-u.ac.jp | |
// @version 0.1 | |
// @description nyan your reports | |
// @author Dolphin Wood | |
// @match https://manaba.kic.kagoshima-u.ac.jp/ct/home | |
// @noframes | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Nyan { | |
constructor(speed = 3) { | |
this.x = 0; | |
this.y = 0; | |
this.max_x = 0; | |
this.max_y = 0; | |
this.vx = this.vy = speed; | |
const img = this.img = new Image(); | |
img.src = 'http://www.nyan.cat/images/thumbs/balloon.gif'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiew |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Timeline based animation engine | |
* | |
* t | |
* ------+------------------------------------------> timeline | |
* +-----|-+ | |
* | A | | <- animation{} | |
* +-----|-+ | |
* +--|------+ | |
* | | A | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ヒラギノ角ゴ */ | |
font-family: "ヒラギノ角ゴ Pro", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, "MS Pゴシック", "MS PGothic", sans-serif; | |
/* ヒラギノ明朝 */ | |
font-family: "ヒラギノ明朝 Pro", "Hiragino Mincho Pro", "MS P明朝", "MS PMincho", serif; | |
/* From: 游明朝体・游ゴシック体のCSSでの利用 - Qiita [キータ] | |
* http://qiita.com/shinnn/items/5be7e8106189311559c1 | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const magnitude = { | |
'十': 1e1, | |
'百': 1e2, | |
'千': 1e3, | |
'万': 1e4, | |
'亿': 1e8, | |
}; | |
const num = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hookMap = new WeakMap(); | |
let currentContext = null; | |
let currentIndex = 0; | |
function load(component) { | |
if (!hookMap.has(component)) { | |
hookMap.set(component, []); | |
} |