Couple months ago, on the new year’s day 2018-01-01, Dog a.k.a. linda_pp or rhysd created a vital.vim module Async.Promise.

INTRODUCTION Vital.Async.Promise-introduction

Vital.Async.Promise is a library to represent the eventual completion or
failure of an asynchronous operation. APIs are aligned to ES6 Promise. If you
already know them, you can start to use this library easily.

Instead of callbacks, Promise provides:

a guarantee that all operations are asynchronous. Functions given to .then()
method or .catch() method is executed on next tick (or later) using
|timer_start()|.

chaining asynchronous operations. Chained operation’s order is sequentially
run and the order is guaranteed.

persistent error handling using .catch() method. Please be careful of
floating Promise. All Promise should have .catch() call not to squash an
exception.

flow control such as awaiting all Promise objects completed or selecting
the fastest one of Promises objects.

If you know the detail of APIs, documents for ES6 Promise at Mozilla Developer
Network and ECMA-262 specs would be great.

As the introduction mentioned, it is an ES6 Promise compatible interface for Vim scripts. You can use it as a fully controllable abstract layer on lowest layer Vim functions job_start/timer_start or vimproc.vim for your plugin developments.

Trivial example: echo message after a while

Let’s implement something like this without blocking Vim.

sleep 5 " This is blocking. We don't want to use `:sleep`
echo 'it has been 5 seconds'

Back then we don’t have timer_start Vim script function, we had to register events such as CursorHold or CursorHoldI to check what time is it and compare with a base you prepared.

Now we have Vim native function timer_start(), so let’s use it first without vital.

I was moved by the fact that llvm opt could optimize my slow inefficient fib function written in brainf**k that compiled to llvm ir by my compiler to an immediate value. It must be beyond awesome when it works with one of the complex languages such as Ruby

a thing that I couldn’t make it during 5 min lightning talk

I fast-forwarded at the end of lightning talk but I didn’t have enough time advertising Fablic, inc where I currently work at.

Personal notes

I have given talks at RubyKaigi twice and RubyConf once in the past. I have experienced a quick and not-really-prepared lightning talk at RubyConf 2009 as well, but not at the very serious and time-restricted RubyKaigi; it was the first time for me. I was so nervous.

The RubyKaigi 2017 this year was really amazing. It didn’t only have great talks, but also helped me seeing lots of friends I haven’t seen for long time. Great also for meeting somebody new.

Steps (total ≤20min labour)

Mix all but flour (water, salt, sugar, and dry yeast) together in a big bowl

Put flour and mix.

It may be tough at first. Leave some time and try again; it should be easier

Put a cover and leave like for 8 hours

I usually do above steps at night, and do below at the next morning

Form it

Sprinkle enough flour both to the top of the bowl and the plate to bake, otherwise you will have hard time removing the baked bread out later.

Preheat oven to 470F

It’s pretty hot!

I preheat after forming the dough, so that dough have enough time to rest.

Sprinkle water and make some coupe

I usually use scissors to cut

Water is to make the dough moisture. Don’t put too much to make them wet

Insert into oven, reduce the heat to 450F, and wait for 25min

Don’t undercook or overcook

If you can see some edges have tiny black line, that’s the time

Undercooked baguettes make it hard to slice and eat, particularly the skin. This may sound opposite, but that was true for me.

Take the bread out, and leave for 30min to cool down

It’s still cooking inside

It’s also extremely hard to slice when it’s too moisture

Slice

Use breadknife. Don’t press. Google how to slice bread

Notes

Baking breads, particularly baguettes, needs the oven to be somewhat moisture. Also the oven needs to be hot even after opening the door to put the doughs in. One solution is to put stones and small bowl with water in advance. But I think that they don’t have to be pure objects that achieve the breads’ requirements, but they can be something that give us additional benefit. Last time I put chicken thighs with some herbs. Since I put chicken in advance, they should have kept high temperature when I re-open the door to put doughs in, and also chicken should have generated some vapour that moisturize the oven room. The baguettes I got were good, and also I got the chicken to be roasted for free.

Buy a big bag of yeast, and keep it in freezer. If it’s inconvenient for you to use, take some batch out into an empty jar or anything.

They taste amazing. Considering the fact that it’s easy for me to make and it costs very low, I think this is really practical recipe that I can keep doing.

I keep the brown baked sprinkled flour into ziploc. They can be used for making white sauce with butter.

I form dough directly on the plate to bake. One less object to clean.

I’m calling this recipe as my bread making version 2. I have published version 1 article in Japanese in the past, but this current version is better and easier.

Currently experimenting making version 3 which won’t use dry yeast but uses sourdough starter.

Things described below are done on my Gentoo Linux on 2015-08-15. However they should apply any X11 Systems such as Debian, Ubuntu, or Arch Linux as well, because none of them are depending on Gentoo specific tools.

Problem: Natural scrolling

This should be easy. Both xfce4 and gnome have config to reverse scroll direction. However, they don’t always reverse only on some GUI apps (such as evince pdf viewer)

xmodmap seems to solve this issue, but it does not.

xmodmap has another issue that if you unplug/plug USB mouse you have to apply xmodmap again.

Let’s find a solution which doesn’t depend on xmodmap, and which also works for any apps including evince.

I’m not a lawyer or a software licensing specialist but just a programmer. Don’t use this blog article as your final decision of doing anything, but check original text both in GPL and EPL.

Speaking of software licenses, I personally prefer GPL, and I also like to always use the latest version as much as possible, so I always try to use “GPLv3 or any later version” in my freesoftware products.

I made a template for lein new to put GPLv3 license info in auto-generated project.clj instead of its default, EPL, since I spent so much time replacing the part every time when I make a new Clojure project. It’s released on clojars.org here and the repository is on github: https://github.com/ujihisa/gpl3p-lein-template.

When tweeted that I was planning to make the package on Twitter, @technomancy, the author of Leiningen, mentioned to me about the license compatibility.

So I researched about the licenses’ compatibility. According to GNU, GPLv3 and EPL aren’t compatible (i.e. if you make a GPLv3 project that depends on a EPL package, nobody can redistribute it with the dependency statically linked together,) but you can add an exception clause under section 7 to allow specific dependencies to re-distribute together.

I added COPYING and LICENSE files in the template to let you write the clause in your project. Enjoy!