Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

付峥 fuzheng1998

🏠
Working from home
Block or report user

Report or block fuzheng1998

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View StatusCode.java
package com.example.demo.security.model;
public enum StatusCode {
OK(200, "OK"),
UNKNOW_ERROR(500, "服务异常"),
WRONG_PAGE(404, "页码不存在"),
;
StatusCode(int code, String msg) {
this.code = code;
@fuzheng1998
fuzheng1998 / pom.xml
Created Aug 30, 2019
pom.xml for jsp and servlet
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test.demo</groupId>
<artifactId>demo</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
View Main.java
package com.company;
import java.sql.*;
public class Main {
static final String DRIVER_CLASS = "com.mysql.jdbc.Driver";
static final String DB_URL = "jdbc:mysql://localhost/test";
static final String USER = "test";
static final String PASS = "test";
@fuzheng1998
fuzheng1998 / booksdb.sql
Last active May 27, 2019
PL/SQL assignment
View booksdb.sql
-- initialize config
connect system/system;
DROP fuzheng CASCADE;
create user fuzheng identified by fuzheng;
grant connect, resource, create table, create view to fuzheng;
set sqlprompt fuzheng>
connect fuzheng/fuzheng;
-- create table
create table Authors(
@fuzheng1998
fuzheng1998 / pom.xml
Last active Mar 16, 2019
Spring and MyBatis maven jar config
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.fuzheng1998</groupId>
<artifactId>ssm</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
@fuzheng1998
fuzheng1998 / .bashrc
Last active Aug 27, 2019
make a trash for Linux
View .bashrc
mkdir -p ~/.trash
alias rm=trash
alias r=trash
alias rl='ls ~/.trash/'
alias ur=undelfile
undelfile()
{
mv -i ~/.trash/$@ ./
}
@fuzheng1998
fuzheng1998 / CheckServlet.java
Last active Oct 21, 2018
simple login with captcha using JSP & Sevlet
View CheckServlet.java
package com.servlet;
import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
import javax.imageio.ImageIO;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@fuzheng1998
fuzheng1998 / include.jsp
Last active Oct 10, 2018
include for JSP
View include.jsp
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>
<%@ page import="java.text.*" %>
<%
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
String formatedTime = sdf.format(date);
out.println(formatedTime);
%>
@fuzheng1998
fuzheng1998 / ForwardServlet.java
Last active Sep 29, 2018
demo for request forward of servlet
View ForwardServlet.java
package control;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@fuzheng1998
fuzheng1998 / chapter 1.md
Created Sep 23, 2018
notes for HTML Cookbook: Chapter 1
View chapter 1.md

Chapter 1: New elements

  1. Document type

    Document type declareration has been shrinked into one line that looks more neat than before.

  2. Header

    it usually include logo and website name, navigation. It may not be only once used in a website page. For example, It could be contained in article element as a head of news.

You can’t perform that action at this time.