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
<textarea id="target"></textarea> | |
<p><button id="btn">插入话题</button></p> | |
<script> | |
var $ = function(id){ | |
return document.getElementById(id); | |
}; | |
$("btn").onclick = function(){ | |
var con = "请在这里输入自定义话题"; | |
//转载文字 |
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
git config receive.denyCurrentBranch ignore |
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
while true; do | |
read -p "Do you wish to install this program?" yn | |
case $yn in | |
[Yy]* ) make install; break;; | |
[Nn]* ) exit;; | |
* ) echo "Please answer yes or no.";; | |
esac | |
done | |
echo "Do you wish to install this program?" |
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
/**异步加载JS的方法*/ | |
function loadJS(url,callback,el){ | |
var isIE = !!window.ActiveXObject, | |
isIE6 = isIE && !window.XMLHttpRequest, | |
script = document.createElement("script"), | |
head = isIE6 ? document.documentElement : document.getElementsByTagName("head")[0]; | |
script.type = "text/javascript"; | |
script.async = true; | |
if(script.readyState){ | |
script.onreadystatechange=function(){ |
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
/* 禁止右键 */ | |
document.oncontextmenu = function () { // Use document as opposed to window for IE8 compatibility | |
return false; | |
}; | |
/*js监听键盘*/ | |
window.onkeydown=function(e){ | |
console.log(e.keyCode); | |
return false; |
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
document.onkeydown = function(e) { | |
// 兼容FF和IE和Opera | |
var theEvent = e || window.event; | |
var code = theEvent.keyCode || theEvent.which || theEvent.charCode; | |
var activeElementId = document.activeElement.id;//当前处于焦点的元素的id | |
if (code == 13 && activeElementId == "search_text") { | |
search();//要触发的方法 | |
return false; | |
} | |
return true; |
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
white-space: nowrap; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
width: 100px;//需要设置一个宽度 | |
//多行文字,最后一行省略号 | |
overflow:hidden; | |
text-overflow:ellipsis; | |
display: –webkit-box; | |
-webkit-line-clamp: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
cd /var/www/htdocs/ | |
$ git clone --bare /path/to/git_project gitproject.git | |
$ cd gitproject.git | |
$ mv hooks/post-update.sample hooks/post-update | |
$ chmod a+x hooks/post-update | |
$ git update-server-info #最后还要执行一下才行 |
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
" 基础 | |
syntax on | |
set ai | |
set history=100 | |
set hlsearch " 高亮搜索结果 | |
filetype plugin on | |
set number "显示行数 | |
set cursorline | |
set foldenable | |
set foldmethod=syntax |
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 checkFirstImg(){ | |
$('<img/>').attr('src',$(imgChecked).attr('src')).load(function(){ | |
firstImg_real_width=this.width; | |
firstImg_real_height=this.height; | |
console.log('宽度'+firstImg_real_width); | |
}) | |
} |
OlderNewer