Skip to content

Instantly share code, notes, and snippets.

View gruggiero's full-sized avatar

Giovanni Ruggiero gruggiero

  • Rome, Italy
View GitHub Profile
@gruggiero
gruggiero / fib.scala
Created August 13, 2020 12:30
Simple Fibonacci with fs2
import fs2.{Stream, Pure}
def fib: Stream[Pure, Int] = Stream(0, 1) ++ fib.zipWith(fib.tail)(_ + _)
fib.take(10).toList

OpenSSL Cheatsheet

Generating Certificates

Generate RSA Private Key + CSR
openssl req -out newkey.csr -new -newkey rsa:[bits] -nodes -keyout priv.key

Generate Self Signed Certificate + Priv Key
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:[bits] -keyout priv.key -out cert.crt

@gruggiero
gruggiero / ReplA.scala
Created November 4, 2016 15:49
Typeable Implicit not found
// Project A has several dependencies, including shapeless_2.10-2.2.5.jar
Welcome to Scala version 2.10.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_66).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import shapeless.syntax.typeable._
import shapeless.syntax.typeable._
import shapeless.syntax.typeable._
(defun ensime-refactor-add-hole (type)
"Add a hole definition and insert it at point."
(interactive "sHole type (default String): ")
(let ((hole-type (if (string= type "")
"String"
type))
(hole-name ""))
(save-excursion
(scala-syntax:beginning-of-definition)
(save-excursion

Keybase proof

I hereby claim:

  • I am gruggiero on github.
  • I am gruggiero (https://keybase.io/gruggiero) on keybase.
  • I have a public key whose fingerprint is A040 6F2D 42D1 48DB 1C1D BB95 40D4 AC1E CE01 EA21

To claim this, I am signing this object: