Skip to content

Instantly share code, notes, and snippets.

View hellokaton's full-sized avatar
:octocat:
Focusing on share

katon hellokaton

:octocat:
Focusing on share
View GitHub Profile
@merryech0
merryech0 / pg_random_int_array.sql
Last active February 9, 2024 13:47
Postgresql function for generating random integer array
CREATE OR REPLACE FUNCTION random_int_array(dim integer, min integer, max integer) RETURNS integer[] AS $BODY$
begin
return (select array_agg(round(random() * (max - min)) + min) from generate_series (0, dim));
end
$BODY$ LANGUAGE plpgsql;
-- usage example
select random_int_array(15, 6, 40);
-- return example
@paulmillr
paulmillr / active.md
Last active June 22, 2026 23:39
Most active GitHub users (by contributions). https://paulmillr.com

Most active GitHub users (git.io/top)

The list would not be updated for now. Don't write comments.

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Because of GitHub search limitations, only 1000 first users according to amount of followers are included. If you are not in the list you don't have enough followers. See raw data and source code. Algorithm in pseudocode:

githubUsers
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
/**
* 一种本地缓存的无锁实现思路
* 适用场景:预先知道的需要缓存的一批数据,比如卖家品牌授权,馆信息,达人信息
* 数据更新不太频繁,定时更新或者更新由自己手动控制
*/
public abstract class AbstractLocalCache<K, V> {