Tags » ruby
-
TIL: A basic socket server in Ruby
My first bit of socket programming is a Ruby server that reads lines from the socket, and prints them. Not useful on its own, but a stepping stone to more exciting things!
-
TIL: You can reset the start of a regex in Ruby
The
\K
escape is the “Match-Reset Anchor”, which resets the start of the reported match, and skip any previously consumed characters. -
TIL: How to get the expiry date of an HTTPS certificate with Ruby
Connect to the domain using
net/http
, then you can inspect thepeer_cert
/not_after
property on the response. -
TIL: Find the shortest prefix to identify a string in Ruby
The built-in
Abbrev
module can calculate a set of unambiguous abbreviations for a set of strings, and then you can look for the shortest result for each string. -
A script to verify my Netlify redirects
I wrote a script that reads my redirect rules, and checks that every redirect takes you to a page that actually exists on my site.
-
Documenting my DNS records
Exporting my DNS records as YAML gives me a plaintext file where I can track changes, add comments, and feel more confident about managing my DNS.
-
TIL: How to suppress installing rdoc/ri docs when running
gem install