Hjertnes.blog

#

January 23, 2018

I’m not that interested in the smart speaker stuff. Also, I’m more or less 100% sure that my dogs and fiancé wouldn’t appreciate listening to geeky podcasts as much as I do.

Handling errors in React

January 23, 2018

With React 16 handling errors with React became a hell of a lot easier than it used to be. The official documentation has all the code you need to get started.

The basic idea is that there is a lifeCycleMethod, and if there is an exception thrown in any component in this or somewhere “under” this component it will trigger. With all the information you need to display an error message to the user, or more important saving it somewhere.

Showing it to the users? Not that important, because most of them will not ever read them. Having a place to keep track of them? Very important, makes it so much easier to fix and deal with all the problems with your app; instead of just those you hear about.

#

January 22, 2018

It’s micro Monday again. This week I recommend [@jack][1](https://micro.blog/jack). A awesome follow, especially if you are into photography, analog stuff or emacs.

New blogs

January 22, 2018

I started a daily JavaScript focused blog in November. Single topic blog posts, sometimes larger series of blog posts if the subject matter is big. Monday through Friday.

And I have also started to hang out over at Micro.blog. You can find me at https://micro.blog/hjertnes or Hjertnes.social or think Twitter, but driven by blogs and rss; with some nice Magic by Manton Reece to make it function more like a social network.

#

January 22, 2018

Installing SilverFast always drives me nuts. The installation process is designed as bad as the software itself. Download a new copy (because the one included with the scanner is outdated). Make sure the scanner is connected to the computer. Then type in a long serial number, before you need to insert the original installation media for it to verify that you actually have the original CD or DVD.

It requires two USB-A to USB-C adapters plus a USB CD Drive to install the damn thing on a modern MacBook Pro.

What’s next

January 22, 2018

The React Introduction is done as far as I’m concerned, at least for now. I’m probably going to write more about react from time to time as I come over cool new stuff. And I’m going to put together a full fledged example projects incorporating what I have written about here in a not too distant future. And I will probably also bring up some stuff I forgot to write about here.

Spacemacs

January 22, 2018

Emacs is a very powerful editor. Much more powerful than anything I have used before.

And it is the kind of tool that begs to be extended.

If you need Emacs to do anythning, you can just write a emacs-lisp function that does that.

You have some core concepts, and a lot of lisp functions that you can use when they are needed.

What most people call the “window” is called the frame, and a window can be divided into any number of windows. Then you can open buffers(files, unsaved files or interactive buffers like shells and repls or even user interface and small applications). Then you can place any buffer in any window. This is much more powerful than the usual files and tabs metphor. It also enables you to do some interesitng stuff like having multiple windows with the same file; useful if you need to look at the top while editing the bottom.

Emacs has some very powerful keyboards shortcuts. Some of them are configuration depended; or all of them are. And some of them depends on the mode emacs is in. You can add modes for dealing with certain file types. The keyboard shortcuts might be the same or very similar for building / compiling source code, but the code behind the mode takes care of what to do.

The core of the power of emacs is Emacs Lisp. It is the programming language most of emacs is written in. And all extentions to emacs is written in. You also use to configure emacs. The idea is that when you run a keyboard shortcut, it is just running the lisp function that shortcut is mapped it. And you can also enter Emacs Command mode and just run any command available.

And it is very easy to add your own, you just have to define it in a .el file and load it in your config. If you for example want to be able to post to Twitter from a emacs buffer, you could just write or find some emacs lisp function for doing that.

#

January 21, 2018

What’s the go to WordPress client on iOS these days?

#

January 21, 2018

I’d pay good money for an iOS version of MarsEdit