- 进入你的
home
目录
cd ~
- 编辑
.bashrc
文件
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
import java.util.Set; | |
import java.util.concurrent.ConcurrentHashMap; | |
public class HelloConvariance { | |
public static void main(String[] args) { | |
ConcurrentHashMap<String, String> properties = new ConcurrentHashMap<>(); | |
Set<String> keySet = properties.keySet(); | |
} | |
} |
1) Create a branch with the tag | |
git branch {tagname}-branch {tagname} | |
git checkout {tagname}-branch | |
2) Include the fix manually if it's just a change .... | |
git add . | |
git ci -m "Fix included" | |
or cherry-pick the commit, whatever is easier | |
git cherry-pick {num_commit} | |
<?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:util="http://www.springframework.org/schema/util" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd | |
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd"> | |
<bean id="systemProps" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> | |
<property name="targetObject" value="#{@systemProperties}" /> | |
<property name="targetMethod" value="putAll" /> |
#!/usr/bin/env bash | |
# should install jq first, for mac:brew install jq | |
# Documentation | |
# https://docs.gitlab.com/ce/api/projects.html#list-projects | |
NAMESPACE="your group name in gitlab" | |
BASE_PATH="https://gitlab.example.com/" | |
PROJECT_SEARCH_PARAM="" |
<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/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.gordondickens.sample</groupId> | |
<artifactId>sample-parent</artifactId> | |
<version>1.0.0</version> | |
<packaging>pom</packaging> |
#!/usr/bin/env python | |
# encoding: utf-8 | |
from __future__ import print_function | |
''' | |
analyze /proc/<pid>/smaps | |
doc | |
http://liutaihua.github.io/2013/04/25/process-smaps-analysis.html |
package com.meiliao.ops.utils.security; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.NoSuchProviderException; | |
import java.security.SecureRandom; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Queue; | |
import java.util.concurrent.ConcurrentLinkedQueue; |
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.