Skip to content

Instantly share code, notes, and snippets.

@06wj
06wj / decode
Created April 19, 2019 06:09
decode js
const fs = require('fs-extra');
const url = '/Users/06wj/Documents/work/chromeOverrides/cdn.xidayun.com/loaclwar_20190407/10/sojson.com.js';
const dict = ["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74", "\x72", "\x61\x64\x64\x45\x76\x65\x6E\x74", "\x63\x61\x6C\x6C\x62\x61\x63\x6B\x50\x6F\x6F\x6C", "\x74\x68\x69\x73\x4F\x62\x6A\x50\x6F\x6F\x6C", "\x69\x6E\x64\x65\x78\x4F\x66", "\x70\x75\x73\x68", "\x72\x65\x6D\x6F\x76\x65\x45\x76\x65\x6E\x74", "\x73\x70\x6C\x69\x63\x65", "\x64\x69\x73\x70\x61\x74\x63\x68\x45\x76\x65\x6E\x74", "\x6C\x65\x6E\x67\x74\x68", "\x61\x70\x70\x6C\x79", "\x75\x73\x65\x72\x4C\x69\x66\x65", "\x75\x73\x65\x72\x4C\x69\x66\x65\x32", "\x66\x69\x72\x65\x53\x74\x61\x74\x65", "\x53\x6F\x63\x6B\x65\x74\x53\x74\x61\x74\x65", "\x70\x6F\x69\x6E\x74\x65\x72\x6C\x6F\x63\x6B\x4F\x75\x74", "\x75\x73\x65\x72\x48\x50", "\x62\x75\x6C\x6C\x65\x74\x4E\x6F\x77", "\x4D\x6F\x75\x73\x65\x53\x70\x65\x65\x64", "\x6B\x69\x6C\x6C\x43\x6F\x75\x6E\x74", "\x70\x69\x6E\x67\x44\x61\x74\x61", "\x69\x6E\x73", "\x69\x6E\x73\x7
@06wj
06wj / image to blob
Created October 1, 2014 03:33
image to blob
var util = {
getBlobUrl:function(img){
if(!this.canvas){
this.canvas = document.createElement("canvas");
this.ctx = this.canvas.getContext("2d");
}
this.canvas.width = img.width;
this.canvas.height = img.height;
this.ctx.drawImage(img, 0, 0);
@06wj
06wj / QuadTree.js
Last active December 21, 2015 22:42
quad
//copied and modified from http://www.nshen.net/article/2011-08-25/as3-DataStructure/
var Rectangle = require("./Rectangle");
var QuadTree = function(rect, maxDepth, currentDepth) {
this._rect = rect;
this._depth = currentDepth || 0;
this._maxDepth = maxDepth || 3;
this._hw = rect.width >> 1;
@06wj
06wj / build.jsfl
Last active December 16, 2015 13:38
flash2canvas
fl.showIdleMessage(false);
var baseURI = fl.baseURI = fl.scriptURI.slice(0, fl.scriptURI.lastIndexOf("/")) + "/";
fl.runScript(baseURI + "utils.jsfl");
log(baseURI, "start");
var data = {};
data.shape = getShapeData();
data.mc = getMcData();
@06wj
06wj / JSON.plugin.jsfl
Created March 7, 2013 02:44
JSON.plugin.jsfl
var haveAFrame;
function getPluginInfo(lang)
{
// fl.trace("==== getPluginInfo");
// fl.trace(lang);
// fl.trace("---- getPluginInfo");
pluginInfo = new Object();
pluginInfo.id = "JSON";
@06wj
06wj / build.py
Created February 22, 2013 08:36
jsfl commands
# coding:utf-8
import os, sys
import codecs
import json
import math
names = json.loads(codecs.open("names.json", "r", "utf-8").read())
baseURL = sys.path[0].replace("\\battleCode\\tools","\\");
dataURL = baseURL + "battleCode\\tools\data\\";
personURL = baseURL + "release\person\\";
@06wj
06wj / h5g
Created July 19, 2012 01:00 — forked from wintercn/h5g
HTML5 Canvas Game Template
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<!--允许全屏-->
<meta content="yes" name="apple-mobile-web-app-capable"/>
<meta content="yes" name="apple-touch-fullscreen"/>
<!--禁止电话号码和邮箱识别-->