What do you want to save?
Add Code snippet
New code examples
-
Ruby 2022-01-23 00:56:07
ruby sign a certificate with the CA
key = OpenSSL::PKey::RSA.new 2048 cert = OpenSSL::X509::Certificate.new cert.version = 2 cert.serial = 2 cert.subject = OpenSSL::X509::Name.parse "/DC=org/DC=ruby-lang/CN=Ruby certificate" cert.issuer = root_ca.subject # root CA is the issuer ce... Add solution -
Ruby 2021-11-16 12:41:18
ruby reorder keys in hash
# First thing to note that #sort/#sort_by will return a new array. Therefore, if we want to return the sorted hash in hash format, we need to call #to_h after #sort. hash = { a:1, bb:2, ccc:4, dddd:3, eeeee:2} # sort on key in decending order puts hash.... Add solution -
Other 2021-09-17 01:29:02
nick j dotfiles
# I would consider these packages essential or very nice to have. The GTK # version of Vim is to get +clipboard support, you'd still run terminal Vim. sudo apt-get update && sudo apt-get install -y \ vim-gtk \ tmux \ git \ gpg \ curl \ ... Add solution