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 / 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 / .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 / Responsive-Box.html
Last active January 4, 2016 13:59
Responsive Box
<div class="post">
<a href="http://www.flickr.com/photos/poagao/4127369934/in/faves-sealour/">
<img class="RDW" width="1024" height="683" src="http://farm3.staticflickr.com/2784/4127369934_cd5c6a6f68_b.jpg" alt="">
</a>
</div>
@Kaiyuan
Kaiyuan / format_url.php
Created January 8, 2014 11:00
格式化 URL,自动判断添加 http 或 https。
<?php
function format_url($url,$slash)
{
/*
* 规范化 URL
* 判断是否使用 HTTPS 链接,当是 HTTPS 访问时候自动添加
* 自动添加链接前面的 http://
* $slash 是判断是否要后面添加斜杠
*/
if (substr($url,0,4)!='http') {
@Kaiyuan
Kaiyuan / footnotes.js
Created November 30, 2013 09:00
footnotes.js
jQuery(document).ready(function($) {
$(document).on('mouseenter','.sup',
function () {
var suptext = $(this).data("text");
var supimg = $(this).data("img");
var surtext = $(this).data("sur");
var subtext = $(this).data("sub");
var sultext = $(this).data("sul");
var sTop = $(window).scrollTop()
var wHeight = $(window).height();
@Kaiyuan
Kaiyuan / EasyRetinaPicture.html
Last active December 25, 2015 08:19
Easy Retina Picture
<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>Easy Retina Picture</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script>
jQuery(document).ready(function($) {
function retinaImg (ajaxBox) {
if (ajaxBox) {
@Kaiyuan
Kaiyuan / Prevent_hotlinking.php
Last active December 23, 2015 06:18
简易防盗链
<?php
$name = $_GET['n']; //获取文件名
$Extension = substr(strrchr($name, "."), 1); //获取格式名
$Pictures = array("png","jpg","jpeg","gif","svg");
$Audios = array("mp3","m4v","m4a","wav","mpa");
$Videos = array("mp4","mov","ogv","ogg","webm");
if (in_array($Extension,$Videos)) { //判断格式设置对应文件夹
$Folder = "videos/";
@Kaiyuan
Kaiyuan / flat-v2ex.css
Last active December 22, 2015 15:29
V2EX 扁平化风格
#Top {background: #333;}
#Top, .item, .item_node, #Search div, .dock_area, .topic_buttons, .super.button, .topic_buttons:hover, .super.button:hover, #Wrapper {background-image: none !important;}
#Search div {background-color: #fff !important;border-radius: 19px;}
.topic_buttons {background-color: #eee;}
.normal.button,.normal.buttonhover {text-shadow: 0 0 0 #fff;}
.box, .normal.button, .normal.button:hover, textarea,input.sl {text-shadow: 0 0 0 #fff;box-shadow: 0 0 0 #fff !important;}
.box {border-width: 0;}
img[alt="V2EX"] {-webkit-filter: invert(100%);}
a, input {transition: all .3s;}
@Kaiyuan
Kaiyuan / baiduyunDLink.php
Last active December 21, 2015 13:59
/?url=百度云下载页面
@Kaiyuan
Kaiyuan / Center_box.html
Last active December 21, 2015 09:29
Center box
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.center {
text-align: center;
}
.centerbox {