Skip to content

Instantly share code, notes, and snippets.

View longforus's full-sized avatar
😳
Girls are not as interesting as code.

Void Young longforus

😳
Girls are not as interesting as code.
View GitHub Profile
@longforus
longforus / SimpleLruCache.kt
Last active October 8, 2021 05:46
[Simple LruCache] Simple LruCache #lru #kotlin
import java.util.*
import kotlin.concurrent.thread
/**
* @describe 最近最少使用队列, 只能使用這里override的api哦
* @author XQ Yang
* @date 4/3/2019 3:09 PM
*/
class LRURequestTimeQueue<T>(val maxSize: Int, private val realQueue: LinkedList<T> = LinkedList()):Deque<T> by realQueue {
@longforus
longforus / time_utils.dart
Last active November 21, 2019 02:59
毫秒时间戳转合适时间长度
/**
* 毫秒时间戳转合适时间长度
*
* @param millis 毫秒时间戳
*
* 小于等于0,返回null
* @param precision 精度
*
* * precision = 0,返回null