Skip to content

Instantly share code, notes, and snippets.

😑
503 Service Unavailable

Dolphin Wood idiotWu

😑
503 Service Unavailable
Block or report user

Report or block idiotWu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@idiotWu
idiotWu / engine.c
Last active Jun 4, 2019
Simple timeline-based animation engine
View engine.c
/**
* Timeline based animation engine
*
* t
* ------+------------------------------------------> timeline
* +-----|-+
* | A | | <- animation{}
* +-----|-+
* +--|------+
* | | A |
View otsuka.js
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
View nyan.js
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';
@idiotWu
idiotWu / Nyanaba.user.js
Last active Nov 28, 2018
nyan your reports
View Nyanaba.user.js
// ==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==
@idiotWu
idiotWu / QuizletHack.user.js
Last active Jun 2, 2018
Hacking the Quizlet Matching Game
View QuizletHack.user.js
// ==UserScript==
// @name QuizletHack
// @namespace http://tampermonkey.net/
// @version 0.0.3
// @description Hacking the Quizlet Matching Game
// @author Dolphin Wood <dolphin.w.e@gmail.com>
// @match https://quizlet.com/*/match
// @grant none
// @run-at document-end
// @noframes
@idiotWu
idiotWu / unlock.js
Last active Nov 19, 2017
Unlock netease music
View unlock.js
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',
};
View fake-observable.js
let currentCaller = null;
class FakeObservable {
constructor() {
this._value = null;
this._callers = new Set();
}
set(val) {
this._value = val;
@idiotWu
idiotWu / extensify.js
Last active Feb 8, 2017
Make built-in classes extendable
View extensify.js
// copied from <https://github.com/service-mocker/service-mocker>
function extensify(Native) {
class Extendable {
constructor(...args) {
this._native = initNative(...args);
checkLack(this._native);
}
}
View es6-feature-detection.js
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' +
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' +
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' +
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));';
try {
eval(str);
} catch(e) {
alert('Your browser does not support ES6!')
}
@idiotWu
idiotWu / setZeroTimeout.js
Created Nov 15, 2016 — forked from mathiasbynens/setZeroTimeout.js
Cross-browser-compatible setZeroTimeout
View setZeroTimeout.js
/*! Cross-browser-compatible setZeroTimeout
*
* I took the original setZeroTimeout and made it cross-browser-compatible, using setTimeout(fn, 0) as a fallback in case postMessage is not supported.
* Mathias Bynens <http://mathiasbynens.be/>
* See <http://mathiasbynens.be/notes/settimeout-onload>
*
* Copyright statement below:
*
* See <http://dbaron.org/log/20100309-faster-timeouts>
* By L. David Baron <dbaron@dbaron.org>, 2010-03-07, 2010-03-09
You can’t perform that action at this time.