Skip to content

Instantly share code, notes, and snippets.

View wileam's full-sized avatar
🐱

Joanna Wu wileam

🐱
View GitHub Profile
@wileam
wileam / dabblet.css
Created March 2, 2014 08:12 — forked from kejun/dabblet.css
sample-1缺点 + 必须固定高度
body {
width: 600px;
font:normal 14px/1.62 arial, sans-serif;
}
.mod {
margin-bottom:100px;
background-color:#efc;
}
.pic {
margin-right: 20px;
@wileam
wileam / accurateFloatCalculation.js
Created September 25, 2014 01:51
javascript accurate float calculation
//除法函数,用来得到精确的除法结果
//说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。
//调用:accDiv(arg1,arg2)
//返回值:arg1除以arg2的精确结果
function accDiv(arg1,arg2){
var t1=0,t2=0,r1,r2;
try{t1=arg1.toString().split(".")[1].length}catch(e){}
try{t2=arg2.toString().split(".")[1].length}catch(e){}
with(Math){
r1=Number(arg1.toString().replace(".",""));
@wileam
wileam / getAbsoluteUrl.js
Created November 26, 2014 09:41
getAbsoluteUrl
function getAbsoluteUrl(url) {
var a = document.createElement('a');
a.href = url;
url = a.href;
return url;
}
@wileam
wileam / variable.less
Created November 27, 2014 07:36
Base css
@sansFontFamily: Arial, "Hiragino Sans GB","Microsoft Yahei", "微软雅黑",sans-serif;
@serifFontFamily: Georgia, "Times New Roman", Times, "SimSun","宋体",serif;
@wileam
wileam / css-ellipsis.css
Last active August 29, 2015 14:11
多行溢出省略
//webkit
p {
overflow : hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
//opera
@wileam
wileam / meta.html
Last active August 29, 2015 14:11
meta
<!-- From 一丝姐姐,详细说明:https://github.com/yisibl/blog/issues/1-->
<!DOCTYPE html> <!-- 使用 HTML5 doctype,不区分大小写 -->
<html lang="zh-cmn-Hans"> <!-- 更加标准的 lang 属性写法 http://zhi.hu/XyIa -->
<head>
<meta charset='utf-8'> <!-- 声明文档使用的字符编码 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <!-- 优先使用 IE 最新版本和 Chrome -->
<meta name="description" content="不超过150个字符" /> <!-- 页面描述 -->
<meta name="keywords" content=""/> <!-- 页面关键词 -->
<meta name="author" content="name, email@gmail.com" /> <!-- 网页作者 -->
@wileam
wileam / .zshrc
Created February 3, 2015 18:02
.zshrc
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Uncomment the following line to use case-sensitive completion.
@wileam
wileam / loading.css
Created April 16, 2015 09:53
loading dots css animation
.loading {
font-size: 30px;
}
.loading:after {
overflow: hidden;
display: inline-block;
vertical-align: bottom;
-webkit-animation: ellipsis steps(4,end) 900ms infinite;
animation: ellipsis steps(4,end) 900ms infinite;
@wileam
wileam / doumailBack.user.js
Last active August 29, 2015 14:21
Doumail Back and Remove Douban App Ads.
// ==UserScript==
// @name Doumail Back & Remove Douban App Ads
// @author Ivan Jiang(iplus26) & Joanna Wu(wileam)
// @match *.douban.com/*
// @grant none
// ==/UserScript==
//
// 标题