Skip to content

Instantly share code, notes, and snippets.

View cho0o0's full-sized avatar
❤️
一期一会

Cyan cho0o0

❤️
一期一会
View GitHub Profile
import kotlin.random.Random.Default.nextInt
fun main() {
println(generatePassword(16))
}
fun generatePassword(length: Int): String {
require(length > 8) { "password length must be longer than 8 characters." }
val lowerChars = ('a'..'z').toList()
val upperChars = ('A'..'Z').toList()
@cho0o0
cho0o0 / Server.go
Created September 10, 2020 03:01
Golang Mock Server
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func main() {
@cho0o0
cho0o0 / HttpMethodOverrideFilter.kt
Created April 7, 2020 06:59
Support X-HTTP-Method-Override Header in Spring WebFlux (Kotlin Version)
import org.springframework.http.HttpMethod
import org.springframework.http.server.reactive.ServerHttpRequest
import org.springframework.http.server.reactive.ServerHttpRequestDecorator
import org.springframework.stereotype.Component
import org.springframework.web.server.ServerWebExchange
import org.springframework.web.server.ServerWebExchangeDecorator
import org.springframework.web.server.WebFilter
import org.springframework.web.server.WebFilterChain
import reactor.core.publisher.Mono
### Keybase proof
I hereby claim:
* I am cho0o0 on github.
* I am c_cho (https://keybase.io/c_cho) on keybase.
* I have a public key ASA2_e4pZ94__YIv4LBysWlOvu5iSvWyXtaU93eCfzCPZAo
@cho0o0
cho0o0 / generateAccesskey.js
Last active March 11, 2024 13:14
Generate Outline access key based on Shadowsocks infomation
const generateAccesskey = (method, password, ip, port) => {
const firstPart = btoa(`${method.toLowerCase()}:${password}`)
const secondPart = `${ip}:${port}`
const accesskey = `ss://${firstPart}@${secondPart}`
return accesskey
}