Skip to content

Instantly share code, notes, and snippets.

View jadiaheno's full-sized avatar

Jonathan E. jadiaheno

View GitHub Profile
@ygotthilf
ygotthilf / jwtRS256.sh
Last active May 4, 2024 09:43
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@kristopherjohnson
kristopherjohnson / minReduce.swift
Last active March 13, 2019 03:44
Using Swift reduce() and min() to find minimum value in an array
struct Value {
let num: Int
init(_ n: Int) { num = n }
}
let a = [Value(3), Value(2), Value(1), Value(4), Value(5)]
let min1: Value = a.reduce(Value(Int.max)) {
($0.num < $1.num) ? $0 : $1