Skip to content

Instantly share code, notes, and snippets.

View lbj96347's full-sized avatar

lbjhk lbj96347

View GitHub Profile
@lbj96347
lbj96347 / pull-to-refresh.html
Created November 11, 2011 05:53
Pull to refresh using javascript!
<!doctype html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<style>
html, body, ul { height: 100%; font-family: Helvetica; margin: 0; padding: 0 }
li { border-bottom:1px solid #E0E0E0; font-size:20px; font-weight:bold; list-style:none outside none; margin:0; padding:8px 0 8px 10px; position:relative; -webkit-transition: opacity .75s ease-in }
#window { height: 100%; overflow: hidden }
#content { position: absolute; background: #fff; width: 100% }
@lbj96347
lbj96347 / iScroll-Pull-to-Refresh.html
Created November 12, 2011 13:26
iScroll Pull to Refresh.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>iScroll demo: simple</title>
@lbj96347
lbj96347 / vim config
Last active April 25, 2016 06:14
vim config
syntax on " 语法高亮
filetype plugin indent on " 文件类型检测
autocmd BufEnter * :syntax sync fromstart
let mapleader=","
set nocompatible " 关闭兼容模式
set autoindent " 打开自动缩,继承前一行的缩进方式,特别适用于多行注释
set nu " 显示行号
set showcmd " 显示命令
set noswapfile " 不使用swp文件
set nobackup " 关闭备份
@lbj96347
lbj96347 / MobileWebAppPageSetup.html
Created November 27, 2011 02:58
Mobile Web App page setup
<!DOCTYPE html>
<html>
<head>
<!-- This is a template for Web App Setup -->
<!-- Author : @CashLee李秉骏 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Deal with the proxy cache and some browser cache here is the setting of the meta -->
<meta http-equiv="cache-control" content="no-cache">
@lbj96347
lbj96347 / iscroll-simple-setup
Created January 10, 2012 13:57
iscoll simple setup
If you have only text and all images have fixed dimensions (ie: explicit width/height) you may use the DOMContentLoaded event.
Besides: header/footer/wrapper/scroller all these elements should be position-absolute.
In the document HEAD add:
<style>
#wrapper {
position:absolute; z-index:1;
top:45px; bottom:48px; left:0;
@lbj96347
lbj96347 / DealChar.html
Created February 1, 2012 03:26
JS处理中英文字符
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>hello world</title>
<script src='library/jquery-1.7.min.js' type='text/javascript'></script>
</head>
@lbj96347
lbj96347 / JS-Regular.html
Created February 1, 2012 06:06
JS正则提取字符串/中文/英文/数字
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>javaScript正则表达式提取字符串中字母、数字、中文</title>
</head>
<body>
<input type="text" id="oText" value="李秉骏的常用代号是96347,英文名字是CashLee噢" size=100><br/>
<input type="button" value="number" onclick="get_character_you_want(this);">
@lbj96347
lbj96347 / rmDelayOnclick.js
Created February 6, 2012 07:09
RemoveDedayOnclick
/*when you use an onclick event in an html element,iPhone webkit browser would have a delay.So you should deal with it.This part of js would help you.You just need to add this file in your html page and use ontouchstart/ontouchend/ontouchmove to replace onclick event */
/* 当你在使用onclick事件的时候,iPhone手机上面的safari浏览器会对事件产生一个延误(大概是0.3秒左右),这个时候你必须对这个事件作出一些处理。 然后用ontouchstart ontouchend ontouchmove去代替原本的onclick事件即可*/
/* how to use it? <a onclick="alert('touch me');">Touch Me</a> that's it */
/* 怎么用它,<a ontouchstart="alert('摸我一下');">摸我</a> that's it */
function NoClickDelay(el) {
this.element = el;
@lbj96347
lbj96347 / sqlFieldType.txt
Created February 13, 2012 14:29
sqlFieldType
bit:1位,0或1的整型数字
int:(integer )4字节,从-2^31(-2,147,483,648)到2^31(2,147,483,647)的整型数字
smallint:2字节,从-2^15(-32,768)到2^15(32,767)的整型数字
tinyint:1字节,从0到255的整型数字
decimal(p,s):数字数据,固定精度为p,宽度为s。从-10^38到10^38-1的定精度与有效位数的数字
numeric:decimal的同义词
money:8字节,从-2^63(-922,337,203,685,477.5808)到2^63-1(922,337,203,685,477.5807)的货币数据,最小货币单位千分之十
smallmoney:4字节,从-214,748.3648到214,748.3647的货币数据,最小货币单位千分之十
float(n):n在1~24之间,4字节,7位精度。从-1.79E+308到1.79E+308可变精度的数字
@lbj96347
lbj96347 / RestructuringJson.js
Created March 6, 2012 14:10
Restructuring JSON
var m = [{a:'a',b:'b'},{a:'c',b:'d'}];
//regard m as a JSON
var img = new Array();
for (x in m )
{
var val = m[x].a;
img[x]={img:val,name:val}
}
//img[0]={img:'a', name :'a'}
//img[1]={img:'c', name :'c'}