Encrypting messages with age (alternative to PGP)
age is a simple, modern and secure file encryption tool, format, and Go library.
It features small explicit keys, no config options, and UNIX-style composability.
Generally we are happy with GPG for encrypting emails. In case you are not happy with the CLI of GnuPG
, this might be a tool you can use under the hood for encryption.
Related cards:
Customize tokenization of the MySQL FULLTEXT parser
The way MySQL's FULLTEXT tokenizer splits text into word tokens might not always be what you need. E.g. it splits a word at period characters.
Since the tokenizer has near-zero configuration options (minimum word length and stopwords list), you n...
How to make Rational#to_s return strings without denominator 1 again
The way Rational#to_s
works on Ruby has changed from Ruby 1.9 on. Here is how to get the old behavior back.
You may want this for things where Rationals are being used, like when subtracting Date
objects from one another.
What's happening?...
How to fix "Too many authentic authentication failures" with SSH and/or Capistrano
You are getting when connecting via SSH or deploying with Capistrano (which uses SSH):
Too many authentication failures for username
This is caused by having too many SSH keys added to your keyring or ssh-agent. Your ssh-agent will throw all...
Tod: A Gem for handling daytime without a date
Tod is a gem for working with daytimes.
Another additional gem?
Thus SQL has a time
datatype for storing time of day in the format hh:mm:ss
, neither Ruby nor Rails themselves offer an elegant way to deal with day times.
Time
and `Dat...
Story Checklist Template
This is an story checklist I use to work on stories. For this purpose I extracted several cards related to the makandra process and ported them into a check list...
Invoices: How to properly round and calculate totals
While it might seem trivial to implement an invoice that sums up items and shows net, gross and vat totals, it actually involves a lot of rules and caveats. It is very easy to create invoices where numbers don't add up and a few cents are missing....
Touch records without running callbacks
ActiveRecord comes with a method touch
which sets the updated_at
timestamp to the current time. Unfortunately it also runs callbacks (and hence validations) on the receiving record, so i...
How to "git diff" with a graphical diff tool
If you are fine with the default console diff most of the time but only sometimes want to use an external tool for viewing a diff, you can use git difftool
.
E.g. viewing git diff
with meld:
git difftool --tool=meld
For each file in ...
Alternative to #to_a and Array(...)
Note: In Rails 3+ you can use Array.wrap
instead of the solution here.
In the past you could use Array(...)
or #to_a
to turn an object into an array, unless it already is an array:
Array(5) ...
How to test inside iframes with cucumber / capybara
When testing with Cucumber / Caypbara, iframes are ignored, so you can't interact with them.
To interact with your iframe, you have to explicitly tell your driver to use it.
You can reference your iframe either [through it's id](https://makandrac...