Skip to content

Instantly share code, notes, and snippets.

View GeekaholicLin's full-sized avatar
💭
I may be slow to respond.

void GeekaholicLin

💭
I may be slow to respond.
View GitHub Profile
@GeekaholicLin
GeekaholicLin / echarts-tooltip-config-01.js
Created August 30, 2017 08:07
[echarts]当hover时,tooltip展示当前的数据,当mouseout时,显示默认tooltip
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: {
@GeekaholicLin
GeekaholicLin / post-merge
Last active August 17, 2017 03:10 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/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() {
@GeekaholicLin
GeekaholicLin / nested_matched.md
Created August 11, 2017 03:45
replace the nested matched string
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已经是处理过后的,直接拼接返回即可
@GeekaholicLin
GeekaholicLin / 0_reuse_code.js
Created June 19, 2017 04:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@GeekaholicLin
GeekaholicLin / Webstorm Keymaps
Created April 16, 2017 09:26 — forked from ivikash/Webstorm Keymaps
Keymaps and Keycodes for webstorm
--- 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>
@GeekaholicLin
GeekaholicLin / theme.md
Created April 15, 2017 17:05
my hexo-theme-ylion configure file
# layout
## menu
menu:
- page: home
  url: /
  icon: fa-home
#- page: archives
#  url: /archives
"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
@GeekaholicLin
GeekaholicLin / linux_and_windows.md
Created April 12, 2017 15:54
Virtualbox中的Linux与Windows主机共享文件夹

首先安装VirtualBox的增强插件。

然后添加共享目录,假设共享目录在Windows下为D:\share,而此共享目录名字为folder-name,则可以在Linux下使用以下命令挂载。

sudo mkdir /home/geekaholic/windows-share # 在Linux下创建文件夹
sudo mount -t vboxsf folder-name /media/windows-share

即可正确挂载。

@GeekaholicLin
GeekaholicLin / webpack2.2_tutorial.md
Last active March 31, 2017 05:16
webpack2.2 tutorial

Webpack2.2 学习

前言

文章是文档、博客以及自己的理解之下完成的,如有纰漏请指出。

虽然说有文档的帮助,但是还是要踩很多坑,只有实践才能帮助自己更好地理解文档。

一些概念

chunk

/*
* 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() {