Skip to content

Instantly share code, notes, and snippets.

View arganzheng's full-sized avatar

arganzheng arganzheng

View GitHub Profile
@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 / index.html
Last active October 15, 2018 03:05
使用bootstrap进行复杂页面布局
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>My Blog</title>
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css">
</head>
<body>
<div class="container">

如何提高消息系统吞吐量

  1. should not block while processing a message
  2. prefer immutable message
  3. batch and piggy(捎带)
  4. avoid polling, try callback notify
  5. cache,但是要注意数据同步更新问题
@arganzheng
arganzheng / PoolingHttpClient
Created June 18, 2015 02:35
An HttpClient with PoolingHttpClientConnectionManager
package org.opentsdb.client;
import static com.google.common.base.Preconditions.checkArgument;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HeaderElement;
import org.apache.http.HeaderElementIterator;