Developing clojure with Emacs Cider is great. To be able to view summaries for clojure functions and special forms, type this in you Cider REPL:
Afterwards, you can do stuff like this:
my.repl> (doc conj)
([coll x] [coll x & xs])
conj[oin]. Returns a new collection with the xs
'added'. (conj nil item) returns (item). The 'addition' may
happen at different 'places' depending on the concrete type.
Emacs has a great mode for using Clojure called Cider. Cider comes with an interactive REPL. The REPL allows you to test your code, start web apps, if you are using Luminus, and all in all accelerates development. One annoying thing though is that you have to refresh Cider every time you saved your sources. The good thing is that you can do this automatically. Just add the following to your init.el. I took the function from a blog post by Kris Jenkins:
'(lambda () (add-hook 'after-save-hook
(if (and (boundp 'cider-mode) cider-mode)
(defun cider-namespace-refresh ()
(define-key clojure-mode-map (kbd "C-c C-r") 'cider-namespace-refresh)
Additionally, you can now run the refresh command manually, by hitting C-c C-r.
Update: I changed the after-save-hook to only trigger if we are in a buffer that has cider-mode enabled. Otherwise every save command in Emacs would have triggered the refresh!
My goal here was to forward emails from my GMX freemail account to my iCloud account. Up until now, I used GMX’s own forwarding capability, which is a bit hidden in the filters settings. However, iCloud cranked up its spam filtering, and is now using spamhaus blacklists, which very often label the GMX forwarding servers as bad.
Hence I would only get bounce mails instead of the actual mails. Since this is no good, I set up fetchmail and msmtp on my root server to do the forwarding for me. First, fetchmail will get all mail on GMX via POP3 and pass it on to msmtp, which will in turn pass it on to the iCloud mx server.
At first I tried to deliver it via authenticated SMTP, but iCloud refuses mails sent this way, if the header from field does not contain any of your own iCloud aliases. This will most of the time be a problem, since we are trying to forward emails that were sent to you, not sent from you.
So first let’s see the ~/.fetchmailrc (make sure to chmod 0600 it):
with proto POP3
there with password "secretpassword"
mda "/usr/bin/msmtp -- email@example.com"
set daemon 300
This will poll GMX every 300 seconds and pass the received mails to msmtp for delivery to firstname.lastname@example.org.
The corresponding ~/.msmtprc looks like this:
You can find out the valid mx entries for iCloud by running nslookup -type=mx icloud.com.
The settings above are assuming Debian stable. Other distributions or operating systems may have the SSL certs at different places in the file system.