Skip to content

Instantly share code, notes, and snippets.

View hasezoey's full-sized avatar

hasezoey hasezoey

View GitHub Profile
@hzhou
hzhou / 170331_2.md
Created April 1, 2017 02:55
Rust's return

A comment for: http://stackoverflow.com/questions/27961879/why-is-using-return-as-the-last-statement-in-a-function-considered-bad-style/43146646?noredirect=1#comment73380218_43146646

"It just is." is not a good answer for adults.

Conventions and styles are in the eyes of the users. If the majority of users find using return intuitive, then it is a good style, regardless what the language designers' opinions. If the majority of users use the "return" style, then it will be the convention.

Rust is quite new, so at this point, there is not really much convention or "good/bad" styles, it is just recommendations and guidelines. You have the choice of following them (a particularly good choice when you don't have much of your own opinions) or ignore them as long as it is still correct (a not bad choice if you have sufficient self-confidence).

@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active August 10, 2026 16:02
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Last update: Nov 2025.

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl ecparam -genkey -name secp384r1 | openssl ec -aes256 -out rootCA.key