Skip to content

Instantly share code, notes, and snippets.

View FrankFang's full-sized avatar
🎯
Focusing

Frank Fang FrankFang

🎯
Focusing
View GitHub Profile
@FrankFang
FrankFang / gist:3655713
Created September 6, 2012 12:22 — forked from randika/gist:299049
Javascript trim with Regular Expressions
<script type="text/javascript">
//Javascript trim() example
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); };
//Usage:
var str = " foo bar ";
alert("Original string: '" + str + "'");
str = str.trim();
alert("Trimmed string: '" + str + "'");
</script>
@FrankFang
FrankFang / .vimrc
Created September 19, 2012 04:12 — forked from Hyvi/.vimrc
vim配置
nmap <F2> a<C-R>=strftime("%c")<CR><Esc>
"http://stackoverflow.com/questions/69998/tabs-and-spaces-in-vim
set tabstop=4
set shiftwidth=4
set expandtab
call pathogen#infect()
syntax on
filetype plugin indent on
@FrankFang
FrankFang / css3prefixes.scss
Created September 20, 2012 09:50
prefixes of browsers
$prefixes : -webkit-, -moz-, -ms-, -o-,"";
@mixin border-radius($radius) {
@each $pre in $prefixes {
#{$pre}border-radius:$radius;
}
}
@FrankFang
FrankFang / tween
Created September 20, 2012 10:49 — forked from icai/tween
Tween Action
var timer;
var originalValue = lib.getScrollTop();
var alteration = lib.getPos(dom).y;
var currentTime = 0;
var duration = 50;
var interval = 25;
function action(){
window.scrollTo( 0, tween.quad.easeInOut(originalValue,alteration,currentTime,duration);
@FrankFang
FrankFang / demo.html
Created November 15, 2012 16:56
a bootstrap demo
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>一个 bootstrap 的 demo</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div class="container">
@FrankFang
FrankFang / win_height.js
Created November 26, 2012 05:34
get window height
var winHeight = document.compatMode == "CSS1Compat" ? document.documentElement.clientHeight : document.body.clientHeight;
@FrankFang
FrankFang / ie_edge.html
Created November 29, 2012 06:59
IE edge
<meta http-equiv="x-ua-compatible" content="ie=edge">
@FrankFang
FrankFang / index.css
Last active December 10, 2015 00:19
CSS 动画
.day-sum { opacity:0;height:0; -webkit-transition: height 0.5s, opacity 0.5s;}
.day-sum:hover { height: 450px; opacity: 1; }
@FrankFang
FrankFang / jslint.js
Created January 24, 2013 14:00
jslint comments
/*jslint multistr:true*/
@FrankFang
FrankFang / box-flex.css
Last active December 13, 2015 21:09
box-flex
.main {
display: -moz-box; /* Firefox */
display: -webkit-box; /* Safari and Chrome */
display: box;
width: 100%;
height: 40rem;
}
.main>nav {
display: -moz-box; /* Firefox */