awman / arch-wiki-man: man the Arch Wiki offline

Note: Kyle from kmkeen.com pointed me to an existing project which solves the same problem this project was trying to solve. It’s super fast and Python-based, check it out. Read on to read about arch-wiki-man if you prefer a Node-based solution or want a somewhat fancier menu.


I got round to finishing my command-line Arch Wiki reader the other day. Basically, it comes with a dependency on my arch-wiki-md-repo, which gives you a local (frequently and automatically updated) copy of the entire (English) Arch Wiki in markdown format. It also gives you an awman command (as in arch-wiki-man) to man or apropos the wiki. This works by querying a local database and then converting markdown to troff on the fly, saving it to a temporary file and spawning a man process to open it.

image title

I personally find it useful to quickly consult the Arch Wiki without having to head to my browser, but another good use case might be if you think you won’t have internet access later but know you will probably want to check the wiki. But mostly, I just made it for learning purposes and because I really wanted this for myself and the existing solutions didn’t work for me at all.

Read More

New version of Pacman released: Updating yaourt and package-query

Pacman 5.0.0 has been released, and for those of us who use it along with yaourt, that means a pacman -Syu willl temporarily be unable to satisfy its dependencies. The reason is that your system’s version of package-query will prevent you from updating to the latest pacman.

Most among you will probably find it easy to upgrade, but if you’re feeling fuzzy or made a little error on the way (causing you to fail to load the shared library libalpm.so.9..), here’s how to do it asap:

1
2
3
4
5
6
7
8
9
10
# remove problematic packages:
sudo pacman -Rdd package-query yaourt
# make sure to update pacman here:
sudo pacman -Syu
# get the latest PKGBUILD for package-query and yaourt:
git clone https://aur.archlinux.org/package-query.git
git clone https://aur.archlinux.org/yaourt.git
# compile and install
cd package-query && makepkg -sri && cd ..
cd yaourt && makepkg -sri

I have been to the mountain top: making code beautiful

I decided to refactor my hexo plugin today and one thing that struck me was how useful promises could be to make my code look beautiful and read nicely.

Here’s an excerpt to show you what I mean:

1
2
3
4
5
6
7
8
9
loadArticles(query, this.locals).then(function filter(articles) {
return filterArticles(articles, filters);
}).then(function select(filtered) {
return selectArticle(filtered);
}).then(function openFn(selected) {
openFile(selected);
}).catch(function catchAll(err) {
console.log(chalk.red('Error: '), err);
});

Read More

Configuring the deoplete asynchronous keyword completion plugin with tern-for-vim

The information contained within this article is not necessarily wrong, but please note that I wrote an update to this article in September 2016:


If you’re a vim-user and you have at least a couple of vim plugins installed, chances are you’ve heard of Shougo. While Tim Pope is still probably the most prolific and well-known author of widely used vim plugins, Shougo is way up there along with him.

Why am I talking about Shougo? Well, like many vim-lovers I have made the move to Neovim, and Shougo had announced over half a year ago that he would create something the people in the Neovim-camp have been waiting for: a high-performing autocompletion plugin that takes advantage of Neovim’s built-in asynchronous job control.

Autocompletion with tern for vim

Well, I’d been using good old SuperTab for basic autocompletion while Shougo worked on his plugin (sadly I’m not skilled enough to help him.. yet) but I just checked the other day and it turns out the wait is over!

Read More

Kyle Simpson's Advanced JavaScript course

I recently read Kyle Simpson’s excellent free You Don’t Know JS book series and to me it felt like a JavaScript: The Good Parts for a new generation of JavaScript coders. The only problem I had with it was that it was so full of revelations and important expositions that by the time I finished the last book in the series, I could hardly remember anymore what the first one was even about.

You don't know JS logo

So I decided to read it a second time, and once again I’m just absolutely floored by the knowledge bombs Simpson keeps dropping on his readers. If you haven’t checked it out by now, I highly recommend you do so, no matter how well you think you already know JS!

Read More