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
// 判断垂直滚动条是否已到底部(或顶部) | |
// 前提1. 要给页面设置DOCTYPE例如<!DOCTYPE html>,直接用<!DOCTYPE>不可以。 | |
// 前提2. body的margin-top和margin-bottom设为0 | |
// 这个是判断垂直滚动条的。判断水平滚动条的也类似。 | |
// 检查垂直滚动条是否已经到底 | |
function isScrollerBottom() { | |
var winH = $(window).height(); | |
var pageH = $(document.body).height(); | |
var scrollT = $(window).scrollTop(); |
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
/* 省略了package和import */ | |
@WebServlet("/download") | |
public class DownloadServlet extends HttpServlet | |
{ | |
protected void service(HttpServletRequest request, | |
HttpServletResponse response) throws ServletException, IOException | |
{ | |
// 获取文件路径 | |
String filePath = "/files/music/宁夏.mp3"; |
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 addScriptTag(src) { | |
var script = document.createElement('script'); | |
script.setAttribute("type","text/javascript"); | |
script.src = src; | |
document.body.appendChild(script); | |
} | |
function result(data) { | |
alert(data.responseData.results[0].unescapedUrl); | |
} |
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
public static void main(String[] args) | |
{ | |
Thread thread = new Thread(new Task()); | |
thread.start(); | |
// 中断线程 | |
thread.interrupt(); | |
System.out.println("exit main thread."); | |
} |
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
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.sql.Savepoint; | |
import java.sql.Statement; | |
public class TestJDBC | |
{ |
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
selector { | |
width: 270px; | |
overflow-x: hidden; | |
text-overflow: ellipsis; | |
white-space: nowrap; | |
} |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>ST</groupId> | |
<artifactId>ai</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<!-- Shared version number properties --> | |
<properties> | |
<org.springframework.version>3.0.0.RELEASE</org.springframework.version> | |
</properties> |
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
# find 文件路径 -name '文件名称模板' | xargs grep '包含的特定文本模板' | |
find ./ -name '*' | xargs grep 'hello' |
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
#!/bin/sh | |
cd ~/git/blogger | |
export tmp=`ps -ef |grep jekyll|head -n1|awk '{print $2}'` | |
kill -9 $tmp | |
rm -rf _site | |
jekyll serve & |
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
/** | |
* @arr 待处理数组 | |
* @handler 处理函数 | |
*/ | |
function handleBatch(arr, handler) { | |
// 参数校验 | |
if (!arr || arr.length == 0 || !handler) return; | |
// 如果没有回调,则直接用循环; |
OlderNewer