Writing blog posts in markdown
is fun! However, it would be more convenient if
I could preview the markdown
file as I write it in my text editor, vim
.
There are two ways of approaching this: 1) Preview markdown
in vim
environment itself. OR 2) Preview markdown
in the browser as HTML
. In this
post, we are going to look at both the ways of previewing. So, let’s get
started..
Elixir: Special Atoms
An Atom in Elixir (and Erlang) is a literal, a constant with a name. Elixir atom is similar to Ruby’s symbol in that the VM checks if it’s already defined in memory and reuses it, instead of re-evaluating it (like in the case of strings).
Elixir: Calling Sudo Commands
In Elixir, to interact with the host system or the virtual machine, we use the
module System
. In order to run a
command on the system, we can use the function
System.cmd/3
:
Elixir: My global .iex.exs file
Before an iex
shell starts, it looks like a file .iex.exs
. It starts looking
at the current directory and if it doesn’t find one, it looks at a global one
at $HOME/.iex.exs
(usually ~/.iex.exs
). All the code inside the file is
loaded and added to the IEx
shell’s context, so all the modules imported,
aliases, required, and bindings from the file are accessible inside the shell.
Terminal: Use last command
The terminal command !$
allows us to to retrieve the previous command in
a terminal session. This allows us to reference the previous commands and append/
prepend if to a new command instead of using ↑ and ↓ arrow keys.