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
#!/bin/bash | |
#function:cut nginx log files for lnmp v0.5 and v0.6 | |
#author: http://lnmp.org | |
#set the path to nginx log files | |
log_files_path="/home/wwwlogs/" | |
log_files_dir=${log_files_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m") | |
#set nginx log files you want to cut | |
log_files_name=(access vpser licess) | |
#set the path to nginx. |
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
# we're in the http context here | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
# Node Nginx 配置 | |
server { | |
server_name yourdomain.com; |
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
server { | |
listen 80; | |
server_name im; | |
access_log /var/www/website/access.log; | |
error_log /var/www/website/error.log; | |
location / { | |
root /var/www/website; | |
index index.html index.htm index.php; | |
} |
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
nohup ssserver -c /etc/shadowsocks.json > /dev/null 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
//判断文件类型 | |
function checkFileType(file) { | |
allowedDocTypes = ["application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]; | |
if (file.type.indexOf("image/") == 0) { | |
return "image" | |
} else if (allowedDocTypes.indexOf(file.type) > -1) { | |
return "doc" | |
} | |
return false | |
} |
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
tryOpenQV: function(url) { | |
var targetOpenUrl = 'tenvideo2://?action=4'; | |
var targetDownloadUrl = 'http://mcgi.v.qq.com/commdatav2?cmd=4&confid=107&platform=aphone'; | |
if (!IsAndroid) { | |
targetDownloadUrl = 'https://itunes.apple.com/cn/app/id458318329?mt=8'; | |
} | |
setTimeout(function() { | |
var startTime = (new Date).valueOf(); | |
if (IsAndroid) { |
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
// set the date we're counting down to | |
var target_date = new Date("Aug 15, 2019").getTime(); | |
// variables for time units | |
var days, hours, minutes, seconds; | |
// get tag element | |
var countdown = document.getElementById("countdown"); | |
// update the tag with id "countdown" every 1 second |
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
/* | |
* 在 Android 下 UA | |
* mozilla/5.0 (linux; u; android 4.1.2; zh-cn; mi-one plus build/jzo54k) applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30 micromessenger/5.0.1.352 | |
*在 iOS 下 UA | |
* mozilla/5.0 (iphone; cpu iphone os 5_1_1 like mac os x) applewebkit/534.46 (khtml, like gecko) mobile/9b206 micromessenger/5.0 | |
*/ | |
function isWeixinBrowser(){ | |
var ua = navigator.userAgent.toLowerCase(); | |
return (/micromessenger/.test(ua)) ? true : false ; |
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
/* | |
* 百度统计 | |
* 需要放在<head></head> | |
*/ | |
<script> | |
var _hmt = _hmt || []; | |
(function() { | |
var hm = document.createElement("script"); | |
hm.type = 'text/javascript'; | |
hm.async = true; |
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
.wrap{ | |
width:50%; | |
height:300px; | |
positon:relative; | |
} | |
.center{ | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
width:50%; |