Skip to content

Instantly share code, notes, and snippets.

View novoland's full-sized avatar

Liu Jing novoland

View GitHub Profile
@novoland
novoland / regex.js
Created December 4, 2013 08:21
常见的正则表达式
/*
基本语法
^ 字串起始
$ 字串結束
n* 0或多個'n'
n+ 1或多個'n'
n? 0或1個'n'
n{3} 只有3個'n'
n{3,} 有3個或多個
n{3,5} 有3個至5個
*, *::active, *::focus {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-focus-ring-color: rgba(0, 0, 0, 0);
outline: none;
-webkit-user-modify: read-write-plaintext-only;
}
@novoland
novoland / GistBox scrollbar.css
Last active January 25, 2017 03:50
webkit scrollbar of gistbox
/*light*/
::-webkit-scrollbar{width:5px;height:5px}
::-webkit-scrollbar-track{background:#ddd}
::-webkit-scrollbar-thumb{background:#999}
/*dark*/
::-webkit-scrollbar{width:5px;height:5px}
::-webkit-scrollbar-track{background:rgba(0, 0, 0, 0.2)}
::-webkit-scrollbar-thumb{background:rgba(0, 0, 0, 0.8)}
/**
* Like, basically PERFECT scrollbars
*/
/*
It's pure CSS.
Since a quick google search will confirm people going crazy about Mac OS Lion scrollbars...
this has no fade-out effect.
In Mac OS Lion, the lowest common denominator is always showing scrollbars by a setting.
<ul id="members" data-role="listview" data-filter="true">
<!-- ... more list items ... -->
<li>
<a href="detail.html?id=10">
<h3>John Resig</h3>
<p><strong>jQuery Core Lead</strong></p>
<p>Boston, United States</p>
</a>
</li>
<!-- ... more list items ... -->
@novoland
novoland / DbMeta.java
Created August 29, 2013 02:29
获取数据库元数据:表/主键/外键。大多数从DatabaseMetaData获取元数据的方法都需要过滤参数如catalog/schema/table。。。大多数时候简单设置为null表明不根据catalog/schema过滤。 Oracle在database下还有schema的划分,有时需要设置schema。
package com.gaohui.jdbc.meta;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import java.sql.*;
import java.util.*;
/**
* 目前只支持mysql,其他数据库未进行测试。
@novoland
novoland / enableHadoopDebug.sh
Created August 27, 2013 07:55
为hadoop开启远程调试,加在bin/hadoop里。
# Turn on debug mode if neccesary
debug_file="$bin/hadoop.debug"
is_debug_enabled()
{
if [ -f $debug_file ]; then
cat $debug_file | grep $1 >/dev/null 2>&1
fi
}
case "$COMMAND" in