This file contains hidden or 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
/* | |
只依据纵向处理固定, 不支持已fixed的的dom, static to fixed | |
*/ | |
var FixedLayer = function(id){ | |
if(!id){ return; } | |
this.dom = document.getElementById(id); | |
if(!this.dom){ return; } | |
//设置固定点 只支持小于等与原位 |
This file contains hidden or 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 Process { | |
//for parent | |
protected $resource; //process resource | |
public $pipes; //process pipes | |
public $php_path = 'php'; //system php path | |
public $script_path = ''; //运行j脚本 | |
protected $start_time; //subproces start time | |
protected $no = 0; //subprocc no | |
public $name = ''; //subprocc name |
This file contains hidden or 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 | |
/** | |
* pdo 的扩展类 | |
* author: wjzhangq <[email protected]> | |
*/ | |
class db implements ArrayAccess, Countable | |
{ | |
protected $tables; //db中所有表 | |
protected $pdo; |
This file contains hidden or 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 | |
/* | |
API Google URL Shortner | |
marcusnunes.com | |
*/ | |
echo goo::get('http://www.baidu.com'); | |
class goo{ | |
function get($url){ | |
$error = ''; |
This file contains hidden or 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 | |
var_dump(mb_str_split('hello 小姐 韩语中字全集')); | |
var_dump(utf8_split('hello 小姐 韩语中字全集')); | |
var_dump(utf8_split_by_mb('hello 小姐 韩语中字全集')); | |
function utf8_split($str){ | |
$bin11 = 0xC0; | |
$bin10 = 0x80; |
This file contains hidden or 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
#!/usr/bin/env python | |
# | |
# Copyright 2009 Facebook | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains hidden or 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 getRangePos(obj){ | |
var Pos = 0; //ie | |
if (document.selection){ | |
obj.focus(); | |
var Sel = document.selection.createRange(); | |
Sel.moveStart('character', -obj.value.length); | |
Pos = Sel.text.length; | |
}else if (obj.selectionStart || obj.selectionStart == '0'){ | |
Pos = obj.selectionStart; | |
} |
This file contains hidden or 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<title>cross 跨域</title> | |
</head> | |
<body> | |
<input type='button' value='开始测试' onclick='crossDomainRequest()' /> | |
<div id="content"></div> |
This file contains hidden or 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 | |
// " MATCH($field) AGAINST('$searchon' IN BOOLEAN MODE) "; | |
//"SHOW GLOBAL VARIABLES LIKE 'ft\\_min\\_word\\_len'"; | |
class normalizeText{ | |
var $mMinSearchLength; | |
var $strictMatching = true; | |
var $searchTerms = array(); | |
var $ignorecase = true; | |
This file contains hidden or 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
// Simple JavaScript Templating | |
// John Resig - http://ejohn.org/ - MIT Licensed | |
(function(){ | |
var cache = {}; | |
this.tmpl = function tmpl(str, data){ | |
// Figure out if we're getting a template, or if we need to | |
// load the template - and be sure to cache the result. | |
var fn = !/\W/.test(str) ? | |
cache[str] = cache[str] || |