Skip to content

Instantly share code, notes, and snippets.

View kymtwyf's full-sized avatar
:octocat:

Wu Yongfeng kymtwyf

:octocat:
View GitHub Profile
@kymtwyf
kymtwyf / myset.Vromerc
Created September 19, 2014 11:22
Vrome custimization
" use CTRl+f to search
unmap <C-f>
" use chrome default CTRL+number to navigate to tabs
unmap g0
unmap g^
unmap g$
unmap <C-p>
" unmap duplicate current tab (Duplicate Tab Shortcut Key is installed for this functionality)
@kymtwyf
kymtwyf / .vimrc
Created July 26, 2015 21:47
Mac下vim中文乱码解决,新建~/.vimrc
let &termencoding=&encoding
set fileencodings=utf-8,gbk,utf-16,big5
@kymtwyf
kymtwyf / Mac 官网快捷键.md
Created October 13, 2015 12:52
Mac 官网快捷键,非常全...
@kymtwyf
kymtwyf / mysql enable remote visit.md
Last active October 15, 2015 02:30
Mysql允许远程访问

先修改/etc/init.d/my.cnf 下

bind-ipaddress = 0.0.0.0(原来是127.0.0.1)

Reference for all ips use below以下命令允许所有IP访问

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' WITH GRANT OPTION;

for particular ip use below以下命令只允许myuser用户通过youripaddres这个IP访问

@kymtwyf
kymtwyf / Mysql 重置密码.md
Created October 15, 2015 02:48
reset mysql password in ubuntu, 重置mysql 密码

Reference

Steps

  1. 先关了mysql
sudo /etc/init.d/mysql stop
  1. 进入安全模式
sudo mysqld_safe --skip-grant-tables &amp;
@kymtwyf
kymtwyf / No suitable driver found for maven.apache.org.md
Last active October 16, 2015 17:03
使用Maven和Mybatis开发时,遇到“java.sql.SQLException: No suitable driver found for http://maven.apache.org”
@kymtwyf
kymtwyf / 配置resource.md
Last active October 17, 2015 01:06
java 文件夹下 Mybatis 的xml被IDE忽略 (可能会导致HTTP Status 500 - Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): xxx)

首先要确定xml的路径是否正确配置

一种方法是

直接把mybatis的xml放到src/main/resources

另外一种方法

pom.xml中加:

<resource>
 ${basedir}/src/main/java
@kymtwyf
kymtwyf / maven配置compiler plugin.md
Created October 26, 2015 02:52
intellij Error:java: diamond operator is not supported in -source 1.5 (use -source 7 or higher to enable diamond operator)
<project>
  ...
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
 3.3
@kymtwyf
kymtwyf / spring 跨域.md
Last active October 26, 2015 11:30
XMLHttpRequest cannot load http://XXX Origin http://XXX is not allowed by Access-Control-Allow-Origin.

参考

HttpServletResponse response = (HttpServletResponse) res;
response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Headers", "这里写允许的头,比如Content-Type 等");
chain.doFilter(req, res);
@kymtwyf
kymtwyf / Tomcat内存设置.md
Last active October 26, 2015 13:00
tomcat memory setup

Reference

Update Java Options for Tomcat

  • vim <TOMCAT_HOME>/bin/setenv.sh
  • export CATALINA_OPTS="-Xms1024M -Xmx2048M -XX:MaxPermSize=1024m"

Xmx: Max Heap size