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 / Hover-Box.html
Last active October 6, 2015 20:48
Hover-Box
<div class="box">
<img class="image" src="http://ww1.sinaimg.cn/large/620eff41gw1e62qpb18kyj20sg0sgadc.jpg" alt="">
<div class="text">
<h2>title</h2>
<p>This's Photo.</p>
</div>
</div>
<style type="text/css">
.box {
width: 100px;
@Kaiyuan
Kaiyuan / gist:3742250
Created September 18, 2012 09:33
div Center
<div class="BoxOne">
<div class="BoxTwo">
X
</div>
</div>
<style type="text/css">
.BoxOne {
position: relative;
width: 100%;
height: 100%;
@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 {
@Kaiyuan
Kaiyuan / baiduyunDLink.php
Last active December 21, 2015 13:59
/?url=百度云下载页面
@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 / 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 / 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 / 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 / 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 / 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>