Skip to content

@ri7nz

Today I learned

Vault: Export GPG

this is an example how to "backup" your "GPG/PGP":

  • basic
1❯ gpg --armor --export <email/key-id> > my_secret.asc
  • use paperkey
1❯ gpg --export-secret-key <email/key-id> | paperkey --output my_secret.asc

ReScript: Quickly evaluate code in terminal

In the toolchain bs-platform have a bsc for compile a ReScript or ReasonML code to JavaScript code (./node_modules/.bin/bsc). We can evaluate a ReScript/ReasonML code in terminal, like this:

  • basic usage
1bsc -e "<ReScript>" | node
  • basic and generated javascript
1bsc -e "<ReScript>" > Code.js
  • Pipe and perform in NodeJs
1❯ ./node_modules/.bin/bsc -e "
2let rec fib = {
3 | 0 | 1 => n
4 | n => fib(n - 1) + fib(n - 2)
5 }
6
76->fib->Js.log2(\"Result of fib 6:\", _)
8" | node
9Result of fib 6: 8

See Detail Here