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 | |
/*** PHPExcel Object ***/ | |
/* Get the default Style object */ | |
(PHPExcel_Style) $style = ((PHPExcel) $excel)->getDefaultStyle() | |
/*** PHPExcel_Cell Object ***/ | |
/* Get the Style object for a Cell */ |
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 | |
// 重装前备份项目 | |
1、相册 -> 百度云 | |
2、通讯录、便签等 -> 小米账号 | |
// 重装后 | |
1、安装百度离线地图 | |
// 所有软件 |
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 | |
1, install package control | |
https://packagecontrol.io/installation | |
2, install packages | |
ProjectManager | |
All Autocomplete | |
ApacheConf.tmLanguage | |
BracketHighlighter |
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 | |
define('DEBUG_LOG_FILE',__DIR__.'/debuglog.html'); | |
class debug{ | |
static function log($str){ | |
file_put_contents(DEBUG_LOG_FILE,self::prepare_str($str)); | |
} | |
static function add($str){ |
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 iframeImg(imgSelector){ | |
var frameStr = '<iframe style="display:inline-block;width:100%;height:100%;border:0 none;"></iframe>'; | |
/*jslint scripturl: true*/ | |
var frameSrc = 'javascript:\'<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" /><style>html,body{width:100%;height:100%;padding:0;margin:0;line-height:0;}</style></head><body></body></html>\';'; | |
$(imgSelector).each(function (){ | |
var imgSrc = this.src; | |
var iframe = $(frameStr).load(function (){ | |
$('<img style="max-width:100%;">').load(function (){ | |
iframe.css({width: this.width, height: this.height}); | |
}).appendTo(iframe[0].contentWindow.document.body).attr('src', imgSrc+'?_t='+Math.random()); |
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
String.prototype.html = function(encode) { | |
var replace =["'", "'", """, '"', " ", " ", ">", ">", "<", "<", "&", "&", "¥", "¥"]; | |
if (encode) { | |
replace.reverse(); | |
} | |
for (var i=0,str=this;i< replace.length;i+= 2) { | |
str=str.replace(new RegExp(replace[i],'g'),replace[i+1]); | |
} | |
return str; | |
}; |
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
#coding:utf-8 | |
# 测试用,把 request 里的各种变量格式化后返回 | |
def show_request(): | |
request_dict = {} | |
request_dict['forms'] = {} | |
for item in request.forms: | |
request_dict['forms'][item] = request.forms.getall(item) | |
request_dict['query'] = {} |
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 | |
// https://github.com/jakajancar/DropboxUploader | |
require_once './DropboxUploader.php'; | |
// dump mysql file | |
$myUser = 'root'; | |
$myPass = 'root'; | |
$myHost = 'localhost'; | |
$myDbs = array('db1', 'db2'); |
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
File dbPath = getDatabasePath("taobaoclient.db"); | |
if (!dbPath.exists()) { | |
try { | |
InputStream is = getAssets().open("databases/taobaoclient.db"); | |
int size = is.available(); | |
byte[] buffer = new byte[size]; | |
is.read(buffer); | |
is.close(); | |
FileOutputStream fos = new FileOutputStream(dbPath); |