var val = '<blockquote><p>pppp[id.]pppp</p><h1>h1h1[id.]h1h1</h1></blockquote><p>pppp[id.]ppppp</p>';
var re = /<(blockquote|p|h1)>(([^]*?)\[\id\.\]([^]*?))<\/\1>/g;
function recMatch(content,re){
content = content.replace(re,function(match,p1,p2,p3,p4){
var matchedChild = p2;
//如果child依然匹配,递归调用
if(re.test(p2)){
matchedChild = recMatch(matchedChild,re);
//matchedChild已经是处理过后的,直接拼接返回即可
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const events = { | |
mouseover: (params, instance) => { | |
var result = params.name + "<br/>"; | |
var circle = | |
'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + | |
params.color + | |
'"></span>'; | |
result += circle + params.seriesName + ":" + params.value + "<br/>"; | |
instance.setOption({ | |
tooltip: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
# Or run the following commond in unix-like terminal | |
# curl -O https://gist.githubusercontent.com/GeekaholicLin/63d03a960eea595e543116dd5de07080/raw/d22bfce02c62e74ebe38e6252c2165061d9aa495/post-merge && chmod +x post-merge && mv post-merge .git/hooks/ | |
changed_files="$(git diff-tree -r --name-only --no-commit-id HEAD^ HEAD)" | |
check_run() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Actions --- | |
$Copy <M-C> | |
$Cut <M-X> <S-Del> | |
$Delete <Del> <BS> <M-BS> | |
$LRU | |
$Paste <M-V> | |
$Redo <M-S-Z> <A-S-BS> | |
$SearchWeb | |
$SelectAll <M-A> | |
$Undo <M-Z> |
# layout
## menu
menu:
- page: home
url: /
icon: fa-home
#- page: archives
# url: /archives
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Vim 基本配置 {{{ | |
set pythondll= " 加载python3而不是python2 | |
set ff=unix | |
let mapleader=";" " 定义快捷键的前缀,也就是<leader> | |
autocmd! bufwritepost $MYVIMRC source $MYVIMRC " 让配置立即生效 | |
set completeopt=menu,preview " 菜单显示补全 | |
set conceallevel=0 " 设置是否隐藏可隐藏文本 | |
set splitright " 垂直分割往右分割 | |
set helplang=cn | |
set encoding=utf-8 |
首先安装VirtualBox的增强插件。
然后添加共享目录,假设共享目录在Windows下为D:\share
,而此共享目录名字为folder-name
,则可以在Linux下使用以下命令挂载。
sudo mkdir /home/geekaholic/windows-share # 在Linux下创建文件夹
sudo mount -t vboxsf folder-name /media/windows-share
即可正确挂载。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Minimal classList shim for IE 9 | |
* By Devon Govett | |
* MIT LICENSE | |
*/ | |
if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') { | |
Object.defineProperty(HTMLElement.prototype, 'classList', { | |
get: function() { |