Skip to content

Instantly share code, notes, and snippets.

View PizzaLiu's full-sized avatar

PizzaLiu PizzaLiu

View GitHub Profile
@PizzaLiu
PizzaLiu / css-fade.css
Last active December 16, 2015 13:29
网页去色
html {
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
}
class qq_msg_sender {
private $qq_num;
private $qq_pw;
private $sid;
public function __construct($qq_num,$qq_pw){
$this->qq_num = $qq_num;
$this->qq_pw = $qq_pw;
}
<html><head> <style type="text/css"> #a { margin:0 10px 10px; } #b { width:100%; } </style> <title>IE Crasher</title> </head> <body> <table><tr><td> <div id="a"> <form id="b"> <input type="text" name="test"/> </div> </td><td width="1"></td></tr></table> </body></html>
function pheader($string,$exit=true,$replace = true, $http_response_code = 0) {
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$string = str_replace(array("\r", "\n"), array('', ''), $string);
if(empty($http_response_code) || PHP_VERSION < '4.3' ) {
@header("Location: http://$host$uri/$string", $replace);
} else {
@header("Location: http://$host$uri/$string", $replace, $http_response_code);
}
if($exit) {
document.body.appendChild(document.createElement('script')).src='http://code.jquery.com/jquery-1.9.1.min.js';
@PizzaLiu
PizzaLiu / css-width-no-overflow.css
Created May 16, 2013 05:07
width:100% + padding no overflow
html, body {width:100%;}
.father-div {width:960px;}
.child-div {width:auto;padding:10px;}
@PizzaLiu
PizzaLiu / sublime_text_key.note.txt
Last active December 17, 2015 15:39
sublime-settings
全屏模式: shift + F11 或 直接 F11
注释/反注释:ctrl + /
打开控制面板: ctrl+shift+p
打开操作命令行: ctrl + `
移动到指定行:ctrl + p 输入 :xxx
定位到选中的文字的下一处: ctrl + 依次按下 k 、d
在光标行后插入空行: ctrl + enter
定位匹配字符(如左括号匹配右括号): ctrl + m
选中匹配字符间的字符:ctrl + shift + m
函数跳转:ctrl + r 输入函数名
// <form method="post" autocomplete="off" action="#" enctype="multipart/form-data">
// <input name="pic" id="pic" type="file" />
// </form>
// 文件数组格式 'pic' 为input name属性
$_FILES['pic'] =
array(
[name] => Balloon.bmp
[type] => image/bmp
[tmp_name] => C:\Windows\Temp\phpF4CC.tmp
@PizzaLiu
PizzaLiu / load_css.js
Last active December 17, 2015 21:39
js动态载入css
function addCss(cssPath){
var newCss=document.createElement("link");
newCss.setAttribute("rel", "stylesheet");
newCss.setAttribute("type", "text/css");
newCss.setAttribute("href", cssPath);
document.getElementsByTagName("head")[0].appendChild(newCss);
}
function removeCss(cssName){
var link=document.getElementsByTagName("link");
@PizzaLiu
PizzaLiu / AjaxFileUploader_guide.txt
Created May 31, 2013 07:25
AjaxFileUploader 2.1
<script type="text/javascript" src="./static/js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="./static/js/ajaxfileupload.js"></script>
<input name="pic" id="pic" type="file" />
function ajaxFileUpload(){
jq('input[name="pic"]')
.ajaxStart(function(){
jq('span.pic-up-notice').html('<img src="./static/image/common/loading.gif" />图片上传ing...');
})
.ajaxComplete(function(){
jq('span.pic-up-notice').html('图片上传完成!<a class="reedit-pic" href="#">修改图片</a>');