Skip to content

Instantly share code, notes, and snippets.

🎳
Having Fun

Jixun Wu jixunmoe

🎳
Having Fun
View GitHub Profile
@jixunmoe
jixunmoe / FakeLib.cpp
Last active Sep 1, 2015
NT88 Fake Lib.
View FakeLib.cpp
// FakeLib.cpp : Defines the exported functions for the DLL application.
//
 
#include <windows.h>
#include "FakeLib.h"
 
int __stdcall _NT3DESCBCDecrypt(char* vi, char* pDataBuffer, int length)
{
    return 0;
}
@jixunmoe
jixunmoe / autokun.js
Last active Aug 29, 2015
llpractice.autokun.js
View autokun.js
(function (window, document) {
if (!window.ga) window.ga = function () {};
function getContent (url, cbSuccess, cbFail) {
var req = new XMLHttpRequest();
req.open ('GET', url);
req.onload = cbSuccess && cbSuccess.bind(req);
req.onerror = cbFail && cbFail .bind(req);
req.send ();
};
@jixunmoe
jixunmoe / bind.gen.without.ctx.js
Last active Jul 6, 2017
[ES6] Bind generator without context.
View bind.gen.without.ctx.js
/**
* Bind generator with context preserved.
* @param {Generator} fn The generator
* @return {Generator} Generator with arguments bind.
*/
var _bind = function (fn) {
var args = [].slice.call(arguments, 1);
return function * () {
var ir = fn.apply (this, args.concat.apply(args, arguments));
var n;
@jixunmoe
jixunmoe / rm_comment.js
Created Dec 26, 2014
移除 // 开头的注释
View rm_comment.js
(function (str) {
// 过滤注释
console.info (str.split('\n')
.filter(function (s) { return ! /^\s*\/\//.test(s); })
.join('\n'));
// 空行也会保留
})(require('fs').readFileSync(__filename).toString())
@jixunmoe
jixunmoe / Hitokoto.url.js
Last active Aug 29, 2015
Hitokoto.url.js
View Hitokoto.url.js
(function (window, location, document) {
if (!window.history || (location.hash && location.hash[1] != '#'))
return ;
var np = 'hitokoto_' + + new Date;
window[np] = function (hitokoto) {
history.replaceState(null, null, '##' + hitokoto.hitokoto + ' <-- ' + hitokoto.source);
};
var keepUpdate = function () {
@jixunmoe
jixunmoe / NEJ.js
Created Oct 9, 2014
网易音乐 NEJ 调试分析
View NEJ.js
// 网易音乐 NEJ 内核
(function() {
window.NEJ = window.NEJ || {};
NEJ.O = {};
NEJ.R = [];
NEJ.F = NEJ.emptyFunction = function() {
return false;
};
@jixunmoe
jixunmoe / fixName.js
Created Jun 30, 2014
Simple name fixer for anime
View fixName.js
/*
Usage:
node fixName.js
--dir Dir to search, or `pwd`
--rule Custom Search RegExp Rule
--mod RegExp Modifier, default to i;
--replace What to replace?
--doRename Comfirm to rename
*/
var fs = require ('fs'),
@jixunmoe
jixunmoe / Chinese.js
Last active Aug 29, 2015
Chinese JavaScript
View Chinese.js
var 中文 = (function () {
var _ = window;
_. = true;
_. = false;
[{
: document,
中文: '文档',
映射: {
createTextNode: '创建文本节点',
@jixunmoe
jixunmoe / clearTimeout.js
Last active Aug 29, 2015
Cancel Timeout
View clearTimeout.js
// 清空之前的 timeout, 如果尚未执行
(function () {
for (var i = setTimeout(function () {}, 0); --i; )
clearTimeout (i);
});
// 添加到脚本声明可「强行启用旧版沙盒」模式,感谢 @坐怀则乱 指正。
// @grant unsafeWindow
@jixunmoe
jixunmoe / ClassHooker.js
Created Jun 9, 2014
Hook Javascript Class Function
View ClassHooker.js
/**
* ClassHooker
* Hook original JavaScript class.
*/
var origionalClass = function (z, y) {
console.group('Debug: origionalClass');
console.log ('arguments:');
console.log (arguments);
this.arg1 = z;
You can’t perform that action at this time.