-
github上你可以用别人的现成的代码 直接 git clone 即可了
-
然后你也想改代码或者贡献代码咋办?
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
// 千万不要这样做: | |
$r = mysql_query("SELECT username FROM user ORDER BY RAND() LIMIT 1"); | |
// 这要会更好: | |
$r = mysql_query("SELECT count(*) FROM user"); | |
$d = mysql_fetch_row($r); | |
$rand = mt_rand(0,$d[0] - 1); | |
$r = mysql_query("SELECT username FROM user LIMIT $rand, 1"); |
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
//插入播放器的css | |
var c = document.createElement('link'); | |
c.setAttribute('href', 'http://172.16.144.62/video-js/video-js.css'); | |
document.head.appendChild(c); | |
//插入播放器的js(为什么不用jquery的插入呢?因为jquery有防xss的限制...) | |
var j = document.createElement('script'); | |
j.setAttribute('src', 'http://172.16.144.62/video-js/video.js'); | |
document.head.appendChild(j); | |
//提取真实地址 |
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
:: 服务端的 svn hook 配置,放置在服务端svn相应项目的 /hook 目录下 | |
"C:\Program Files\VisualSVN Server\bin\svn.exe" update C:\Zend\Apache2\htdocs\ --quiet --non-interactive --username aaa --password bbb | |
:: 参数说明 | |
:: C:\Program Files\VisualSVN Server\bin\svn.exe 安装的svn位置 | |
:: C:\Zend\Apache2\htdocs\ 需要项目自动部署的位置(需要提前svn checkout) | |
:: --username aaa 就填有读写权限的svn帐号 | |
:: --password bbb 上面帐号对应的密码..(废话 |
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 something = "http://www.baidu.com"; //任意同域资源,size越小越好 | |
var xmlhttp = new XMLHttpRequest(); | |
xmlhttp.open("GET", something, false); | |
xmlhttp.send(); | |
console.log("服务器时间:" + new Date(xmlhttp.getResponseHeader("date"))); //自己解析响应头,不一定是"date"的 | |
console.log("本机的时间:" + new Date()); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<style type="text/css"> | |
body{ | |
font: normal 13px Roboto,arial,sans-serif; | |
} | |
.dialog{ | |
position: fixed; |
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
//引入jquery | |
var j = document.createElement('script'); | |
j.setAttribute('src', 'http://cdn.bootcss.com/jquery/2.1.1/jquery.min.js'); | |
document.body.appendChild(j); |
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 d = document, c = d.createElement('CANVAS'); | |
c.height = c.width = 100; | |
var ctx = c.getContext('2d'); | |
ctx.textBaseline = "top"; | |
var hanzi2dianzhen = { | |
paintFont : function(char, size, font) { | |
ctx.clearRect(0, 0, c.width, c.height); | |
ctx.font = [size, 'px', ' ', font].join(''); | |
ctx.fillText(char, 0, 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
/*! | |
* 简单的"回到顶端"按钮,javascript封装版 | |
* wenhao(viko16) - v0.0.2 (2013-12-14 14:00:31+0800) | |
* Released under MIT license | |
* 需要先引入jquery框架 | |
*/ | |
$(document).ready(function() { | |
//在body结束前添加按钮 | |
$('body').append('<a href="#" class="back-to-top">回到顶端</a>'); |
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
/// <summary> | |
/// 切换panel的显示效果 | |
/// </summary> | |
/// <param name="panelname">panel的名字</param> | |
private void changeView(string panelname) | |
{ | |
foreach (Control cn in this.Controls) | |
{ | |
if (cn is Panel) | |
{ |