Skip to content

Instantly share code, notes, and snippets.

View arganzheng's full-sized avatar

arganzheng arganzheng

View GitHub Profile
@arganzheng
arganzheng / ok.jsp
Created July 11, 2013 08:30
可以使用这个ok.jsp检查应用是否正常启动
<%@page import="org.springframework.web.context.WebApplicationContext"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.web.context.support.XmlWebApplicationContext"%>
<%
XmlWebApplicationContext context = (XmlWebApplicationContext)WebApplicationContextUtils.getWebApplicationContext(application);
try{
if(!context.isActive()){
context.refresh();
}
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>微生活抽奖模块管理后台</title>
<link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="/static/css/datetimepicker.css" rel="stylesheet" media="screen">
</head>
<body>
@arganzheng
arganzheng / 开放平台鉴权学习.md
Last active November 28, 2017 16:07
开放平台点滴积累

鉴权学习

对于一个API请求,开发平台一般需要知道下面几件事情:

  1. 哪个应用发起这个请求(Which application is making the request)
  2. 这个请求是为哪个用户发起的(Which user the request is posting on behalf of)
  3. 用户是否对这个请求进行授权(Whether the user has granted the application authorization to post on the user's behalf)
  4. 请求是否在传输过程中被篡改(Whether the request has been tampered by a third party while in transit)
@arganzheng
arganzheng / Import an existing repository to Bitbucket
Last active December 19, 2015 03:59
Git常用命令备忘录
如果你本地工程已经是一个Git Repository(已经执行过[Import an existing, unversioned code project to an empty repository]),那么可以这样把它加入你在Bitbucket创建的远程仓库中:
cd /path/to/my/repo
# Creates a remote named "origin" pointing at your GitHub/Bitbucket repository (设置远程仓库地址)
git remote add origin ssh://git@bitbucket.org/arganzheng/remote-terminator.git
# Sends your commits in the "master" branches to GitHub/Bitbucket
git push -u origin master
当然在你能push之前必须先设置你的账号信息,并且最好使用Password Caching或者SSH key避免每次提交代码都要提示输入密码。