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 / config_2016.11.16.md
Last active December 15, 2016 06:01
[config--IDEA]改变IDEA中JSP的发布目录

~~~参考: http://stackoverflow.com/questions/13862032/change-default-web-application-directory-in-intellij-12~~~

~~~设置到Tomcat的目录~~~

---
update:

经过一个下午的摸索,终于搞清了IDEA中Tomcat的设置。
@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 / vsc.md
Last active August 11, 2019 02:34
windows环境的命令行下使用visual studio code创建或打开文件
  1. 先将visual studio code 的安装目录(有着code.exe的文件)添加到环境变量Path中

2.使用一下命令:

code -- opens Visual Studio Code 
code . -- opens current directory in Visual Studio Code 
code somefile -- opens somefile in Visual Studio Code
@GeekaholicLin
GeekaholicLin / dymaticFieldValue.md
Created October 24, 2016 13:59
Java动态设置属性值

从文件中读取数据,然后利用反射在运行时更新属性的值。

在初次看到这个作业的时候,我的做法是,分割字符串(字符串中,每一行为fieldName = fieldValue的形式), 然后将字符串使用parseInt()等类似的方法转换为int 类型和boolean类型的属性值。

 String[] filedAndValue = filedValue.split("[=\\n]");//分割字符串,前面为属性名,后面为属性值
        int fHalfLength = (filedAndValue.length) / 2;
        for (int i = 0; i < fHalfLength; i++) {
            Field f = personClass.getDeclaredField(filedAndValue[2 * i].trim());
@GeekaholicLin
GeekaholicLin / pro_typescript_chapter1.md
Last active October 15, 2016 14:02
<Pro TypeScript>Notes

Chapter 1

Type

Type annotations【类型标注,类型表明】

常见的如下:

// primitive type annotation
@GeekaholicLin
GeekaholicLin / iterator.md
Created October 9, 2016 10:05
the iterator of Javascript[JS中的迭代]

截至目前(ES6),Javascript中的迭代有好几种,让我们来看看它们之间有什么区别。

最简单的for循环--遍历数组

var myArray = ["Geekaholic","male","21"];
for(var i = 0,mLength = myArray.length;i<mLength;i++){
  console.log(myArray[i]);
}
//outputs:Geekaholic

今天在处理轮播图的时候,遇到一个小小的用户体验不好的情景--当左右切换过快,导致双击选择元素的时候,会在图片的上面出现蓝色的前景。

在查询了一番,最终解决了该"bug"

在所需处理的元素上,比如<ele></ele>,将其onselectstart事件设置直接返回false,也就是onselectstart="return false",这个支持IE及Chrome, 但这个不支持FireFox。

但对于现代浏览器,有一个通用的思路,那就是尽量借助CSS。

@GeekaholicLin
GeekaholicLin / node.md
Created September 25, 2016 04:57
windows下打造好用的Nodejs开发环境

多版本Nodejs管理 nvm windows

npm镜像选择管理[解决被墙问题] nrm

PS: 初次安装可以选择暂时设置淘宝镜像。比如

npm --registry=https://registry.npm.taobao.org install -g nrm

加速下载nrm

@GeekaholicLin
GeekaholicLin / tomcat_service.md
Created September 13, 2016 02:38
Tomcat startup script not running

最近在折腾ubuntu服务器的时候,使用sudo apt-get install tomcat7安装了tomcat7后,在/usr/share/tomcat7/bin/目录下无法启动tomcat7, 显示如下错误:

Using CATALINA_BASE: /usr/share/tomcat7 Using CATALINA_HOME: /usr/share/tomcat7 Using CATALINA_TMPDIR: /usr/share/tomcat7/temp Using JRE_HOME: /usr/lib/jvm/default-java Using CLASSPATH: /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar touch: cannot touch `/usr/share/tomcat7/logs/catalina.out': No such file or directory

@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虚拟机

##做法: