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 / webstorm-terminal.md
Last active November 2, 2017 01:55
instead-of-webstorm-built-in-terminal

修改Webstorm的Terminal为自己定义的Terminal.(主要是内建的使用系统自带,功能受限)。

  1. 首先安装g功能强大的 babun

  2. 将zsh.exe的路径[不是babun.bat]添加。比如 "D:\babun.babun\cygwin\bin\zsh.exe"

  3. Enjoy it.


@GeekaholicLin
GeekaholicLin / geekaholic-test.xml
Last active September 23, 2017 16:48
sync windows application xml file[testing example]
<root>
<license name="org.gnu.GPLv2">
<title>Dependency Walker license</title>
<url>http://www.dependencywalker.com/</url>
</license>
<package name="com.Geekaholic.MySQLCommunityServer64">
<title>Geekaholic--MySQL Community Server 64 bit</title>
<url>http://www.mysql.com/downloads/mysql</url>
<description>SQL database x86_64</description>
<icon>
@GeekaholicLin
GeekaholicLin / gitBash_windows.md
Created September 20, 2017 09:51 — forked from evanwill/gitBash_windows.md
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows is bundled with "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available. (Note: a portable alternative is Cmder, the full version comes bundled with Git Bash, notes here.)

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on). If you are missing a utility, such as wget, track down a binary for

@GeekaholicLin
GeekaholicLin / side-effect.md
Created September 18, 2017 14:49
what is side effect in programming?
除了返回值以外,影响到函数外部的任何东西(显示器、网络、文件、全局变量等)的效果都叫side effect
@GeekaholicLin
GeekaholicLin / angular-validation-config.js
Created September 13, 2017 09:00
[angular-validation] Focus and scrollTo invalid field in Form,making non-input field under consideration
/* Edited by Geekaholic */
/* For scrollTo invalid form field*/
let timer = null;
$validationProvider.invalidCallback = function(element) {
element.closest('.form-group').addClass('has-error');
if(!timer){
timer = setTimeout(function () {
let isEditing = angular.element('input:focus')[0];//是否正在编辑,用户体验
if(!isEditing){
let offset = angular.element('.form-group.has-error').offset();
@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 / virtaulbox_advanced.md
Created September 11, 2016 10:45
virtualbox和双系统的高级使用--使用物理盘中的系统建立虚拟镜像

##使用需求:

在安装Linux和Windows双系统的情况下,在一个系统中通过虚拟机启动另外一个系统

##个人环境:

C盘装有Windows 10,D、E、F、G盘为数据盘,H盘为Linux Mint18系统(别问我为什么那么多盘..1T的容量),外加两个环境中的virtualbox虚拟机

##做法:

@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