Skip to content

Instantly share code, notes, and snippets.

View symbioticstar's full-sized avatar
😅
Rust no more

Kazune symbioticstar

😅
Rust no more
View GitHub Profile
@Fobxx
Fobxx / shige-skins.md
Last active March 15, 2024 19:56
Shigetora skins
@msievers
msievers / [Spring, JMH] Howto integrate JMH benchmarks with Spring.md
Last active March 23, 2024 21:12
[Spring, JMH] Howto integrate JMH benchmarks with Spring

Motivation

Integrate JMH (Java Microbenchmarking Harness) with Spring (Boot) and make developing and running benchmarks as easy and convinent as writing tests.

Idea

Wrap the necessary JMH boilerplate code within JUnit to benefit from all the existing test infrastructure Spring (Boot) provides. It should be as easy and convinent to write benchmarks as it is to write tests.

TL;DR;

@soulmachine
soulmachine / jwt-expiration.md
Last active April 9, 2024 04:12
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

@willshiao
willshiao / aes.go
Last active January 19, 2024 16:18
AES 256-CFB in Node.js, Go, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"fmt"
"io"
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active April 18, 2024 18:06 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话: