Skip to content

Instantly share code, notes, and snippets.

View hsipeng's full-sized avatar

Hsi P'eng hsipeng

View GitHub Profile
@hsipeng
hsipeng / slider-autoplay.js
Created May 27, 2017 03:08
slider with autoplay function,using plain javascript.
var slideIndex = 1;
var t;
shwoSlides(slideIndex);
function pulsSlides(n) {
shwoSlides(slideIndex +=n);
}
function currentSlide(n) {
shwoSlides(slideIndex = n);
@hsipeng
hsipeng / applicationContext.xml
Created July 3, 2017 02:00
Spring applicationContext.xml 文件头
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
@hsipeng
hsipeng / VerifyCodeServlet.java
Created July 3, 2017 03:12
java生成验证码
package com.servlet;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.Random;
import javax.imageio.ImageIO;
import javax.servlet.ServletException;

begin

sudo apt-get install git git config --global user.name "Your Name" git config --global user.email "your email"

ssh-keygen -t rsa -C "youremail@example.com"

win

$ cd ~/.ssh

## DBUtil
```
package jdbc2;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
@hsipeng
hsipeng / C:\Users\用户名\.m2
Created July 4, 2017 03:26
收集的国内maven镜像地址
<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
you under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
@hsipeng
hsipeng / xe.sql
Created July 4, 2017 08:41
orcale切换默认端口号
begin
dbms_xdb.sethttpport('8081');
dbms_xdb.setftpport('0');
end;

JAVA_HOME" "C:\Java\jdk1.8.0_05"(即JDK的安装路径) "Path",在原变量值的最后面加上“;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin” “CLASSPATH”,变量值“.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar”

@hsipeng
hsipeng / pattern.md
Created July 12, 2017 08:38
表单验证常用的15个JS正则表达式

用户名正则

//用户名正则,4到16位(字母,数字,下划线,减号)
var uPattern = /^[a-zA-Z0-9_-]{4,16}$/;
//输出 true
console.log(uPattern.test("caibaojian"));

密码强度正则

@hsipeng
hsipeng / IDEA.md
Created July 16, 2017 05:09
IDEA激活服务器地址