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
function basetrans(srcchars, dstchars){ | |
var srcbase = isUnique(srcchars) && baseNum(srcchars, false), | |
dstbase = isUnique(dstchars) && baseNum(dstchars, true), | |
srcbase_bitlen = Math.log2(srcbase), | |
dstbase_bitlen = Math.log2(dstbase) | |
if(!srcbase || !dstbase){ | |
throw new Error("argument string is not unique chars") | |
} | |
if(!srcbase_bitlen || !dstbase_bitlen){ | |
throw new Error("length of argument string is too short") |
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
function makeIndex(get_elem_selector, set_elem_selector){ | |
var glem = document.querySelector(get_elem_selector) | |
var slem = document.querySelector(set_elem_selector) | |
if(!glem || !slem) throw "element not found" | |
var hs = [] | |
!function recur(elem){ | |
var match = elem.tagName.match(/^H([1-9])$/) | |
if(match){ | |
hs.push([+match[1], elem.textContent]) | |
}else{ |
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
!function(){ | |
// style | |
var style_inner = ` | |
.loading-container{ | |
position:fixed; | |
top:0; | |
left:0; | |
right:0; | |
bottom:0; |
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
!function(){ | |
Array.prototype.cursorInit = function(){ | |
this.cursor = 0 | |
return this | |
} | |
Array.prototype.cursorEnd = function(){ | |
this.cursor = this.length ? this.length - 1 : 0 | |
return this |
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
var Colors = { | |
dat : { | |
aliceblue:"#f0f8ff", | |
antiquewhite:"#faebd7", | |
aqua:"#00ffff", | |
aquamarine:"#7fffd4", | |
azure:"#f0ffff", | |
beige:"#f5f5dc", | |
bisque:"#ffe4c4", | |
black:"#000000", |
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
!function(){ | |
Object.prototype.mcall = function(method, bind_this){ | |
var that = this | |
var this_to_arg = true | |
var fn = method | |
if(typeof fn === "string" && fn.charAt(0) === ":"){ | |
fn = fn.substr(1) | |
bind_this = window | |
} | |
else if(arguments.length < 2){ |
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
!function(){ | |
var zoom_active = false | |
var zoom_change = false | |
var zoom_per = 1.08 | |
var init = function(){ | |
document.body.style.zoom = 1 | |
} | |
if(document.readyState === "complete"){ | |
init() |
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
<?php | |
class Object{ | |
function __call($name, $arguments){ | |
if(is_object($this->__proto__)){ | |
$meth = $this->__proto__->$name; | |
array_unshift($arguments, $this); | |
return call_user_func_array($meth, $arguments); | |
}else{ | |
throw new Exception(); | |
} |
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
<?php | |
class InputGetter{ | |
function __get($key){ | |
return null; | |
} | |
function __construct($array){ | |
foreach($array as $key => $val){ | |
$this->$key = $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
function FlowControl(auto){ | |
this.auto = !!auto | |
this.finish = {} | |
this.wait = [] | |
this.units = {} | |
if(document.readyState === "complete"){ | |
this.set("load") | |
}else{ | |
window.addEventListener("load", function(){ |
OlderNewer