Skip to content

Instantly share code, notes, and snippets.

View Kaiyuan's full-sized avatar
🥱
Have nothing to do all day long.

Kaiyuan Xie Kaiyuan

🥱
Have nothing to do all day long.
View GitHub Profile
@Kaiyuan
Kaiyuan / .htaccess
Last active August 29, 2015 14:02
PHP 重写 URL 后获取地址中的参数
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# RewriteBase 是文件目录
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule 是映射到的实际文件
RewriteRule . /index.php [L]
@Kaiyuan
Kaiyuan / weibo-v6.css
Last active July 29, 2016 02:43
微博 V6 简化
body {
font-family: "Helvetica Neue", Ubuntu, "WenQuanYi Micro Hei", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Micro Hei Mono", "WenQuanYi Zen Hei", "WenQuanYi Zen Hei", "Apple LiGothic Medium", "SimHei", "ST Heiti", "WenQuanYi Zen Hei Sharp", Arial, sans-serif !important;
}
div#Box_right, #pl_content_biztips, #plc_main>.WB_main_r, div[node-type="feed_spread"], #v6_pl_ad_bottomtip, #v6_pl_content_biztips {display:none !important;}
.W_func,div[feedtype="ad"], body .footer_adv {display: none !important}
body .send_weibo .input .input_detail {
width: -webkit-calc(100% - 14px);
width: calc(100% - 14px) !important;
}
body .WB_main_c {width: 99% !important;margin: 0 !important;}
@Kaiyuan
Kaiyuan / donated.html
Last active April 27, 2016 21:19
使用 JS 提交 Post 的 PayPal 捐赠按钮。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Donate</title>
</head>
<body>
<input id="ppButton" class="ppButton" type="submit" border="0" name="button" alt="PayPal" value="Donate">
</body>
</html>
@Kaiyuan
Kaiyuan / AndroidCaptivePortalServer.md
Last active September 7, 2016 15:10
Android 5.0 解决叹号提示的问题

现在网上下载 ADB,然后解压好。我打包的: http://pan.baidu.com/s/1jIdKJ1G

手机打开开发者 USB 调试,然后用 USB 线连接电脑授权调试。

然后运行 CMD输入下面的命令。

ADB所在所在目录\adb shell "settings put global captive_portal_server captive.v2ex.co"
@Kaiyuan
Kaiyuan / boxks-cse-style.css
Created September 13, 2016 21:33
BOXKS blog Google cse style
/**
* Default Theme, v2.
*
*/
/* Slight reset to make the preview have ample padding. */
#SearchPageBox {
height: 40px;
border: 1px solid #d7d7d7;
border-radius: 6px;
width: -moz-calc(100% - 2px);
@Kaiyuan
Kaiyuan / Atom 使用 SS 代理.sh
Created January 21, 2017 14:33
Atom 使用 SS 代理
apm config set https-proxy socks5://127.0.0.1:1080
@Kaiyuan
Kaiyuan / Wordpress-nginx.conf
Created January 23, 2017 02:27
Wordpress 使用 nginx 禁止不带参数访问 xmlrpc.php 和 wp-login.php
location ~* /(xmlrpc.php)$ {
if ($is_args = '') {
rewrite ^(.*) http://127.0.0.1/ permanent;
}
# location ~ .*\.php?$args {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index xmlrpc.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name;
include fastcgi_params;
# }
@Kaiyuan
Kaiyuan / README.md
Last active February 28, 2020 02:31
node 唤醒设备模块

Npm Install express body-parser wol silly-datetime

npm install express body-parser wol silly-datetime --sava

sudo npm install pm2 -g

sudo pm2 start /volume1/web/node/pm2_config.json
@Kaiyuan
Kaiyuan / cloudflare.sh
Last active May 1, 2019 00:28
Cloudflare DDNS 脚本
#!/bin/bash
NEW_IP=`curl ip.changeip.com|sed -e 's/<.*$//'`
NOWTIME=`date`
CURRENT_IP=`cat /var/tmp/current_ip.txt`
LOG_FILE="/var/log/cloudflare_ddns.log"
IP_FILE="/var/tmp/current_ip.txt"
ZONE_ID='Domain Zone ID'
LOGIN_MAIL='login@mail.com'
API_KEY='Global API Key'
DDNS_ZONE='ddns-zone-key'
@Kaiyuan
Kaiyuan / 2gif.bat
Last active January 24, 2024 04:17
用 ffmpeg 和 gifski 将视频转为高画质 GIF 的 bat。
set filelink=%1
set filedir=%1_
mkdir %filedir%
ffmpeg -i %1 %filedir%\frame%%04d.png && gifski --fps 25 --quality 80 --quiet -o %filelink%.gif %filedir%\frame*.png && rmdir /s/q %filedir%
exit