hjertnes.blog

#

23.01.2018 01:00

I just got my invite to the Drafts 5 beta. Drafts have been one of my all time favourite iOS apps, I’m pretty sure I have used more or less every single point release of it. And I continue to enjoy it quite a lot.

The idea behind it is very simple: just start writing and worry about where it goes later. What makes it powerful is how you can define your own actions. In the past it was limited to url actions. While powerful, you were limited to sending the text to applications on your iOS device that had implemented a url scheme.

A url scheme is just a way where apps can define their own “protocol”, you could think of http:// as a url scheme claimed by Safari, 1Password used to have a 1p:// scheme (or something like that) in the old days to make it easier to open stuff in the 1Password in-app browser. This was way before extensions in mobile Safari.

Version five brings this to the next level by adding integrated support for talking to web services; this is done through JavaScript. This means that you could post directly to Micro.blog or your WordPress site instead of having to first send it to the WordPress app or Micro.blog app and then publish it from there.

It looks great, and I can’t wait. And it looks like more of the heavy lifting have been taken care of, compared to if you wanted to do something similar using Pythonista.

#

23.01.2018 01:00

[@hjertnes]1 test

#

23.01.2018 01:00

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.

#

23.01.2018 01:00

Handling errors in React

23.01.2018 01:00

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.

#

22.01.2018 01:00

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

#

22.01.2018 01:00

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.

Being left handed.

22.01.2018 01:00

As a white straight cis male working I don’t have that much experience that the system are working against me; and I don’t experience much fill-in-your-ism-of-choice-here.

But there is one area where I really can feel it. I’m left handed. There are some products more than others that seems to be designed in a way where they have made a mathematical model for the dead center for normal or the bullseye of normal. And then they have designed a product to serve them, and to only test it on people who qualify as normal.

There are a few products I always bring up when I complain about this, the Vanishing Point or the Lamy Safari; but you can also spot some of the same problems if you look at for example the nibs available for the Lamy 2000.

The problem with the Lamy Safari, and all the other “cheaper” Lamy pens is that the grip section is molded, and it doesn’t work that great when the way you hold the pen is opposite of “Normal man”. While the problem with the Vanishing Point is just that the clip becomes a little bit “in the way” if you are left handed; the difference is that, if you are right handed it will end up between your thumb and your index finger; while for us lefties it ends up between your index finger and middle finger.

Both of these problems could be solved relatively easy; you just make a “reversed” version. The problem with the Lamy 2000 nibs are that the “Oblique” nibs don’t come in a lefty version, and good luck writing with those left handed.

I’m pretty sure they don’t do this to be assholes or anything like this. I just think that they didn’t even consider testing it on left handed people before putting it out there.

I just wish that more companies did a better job to make sure their products either work for everyone or that it is a version that works for everyone.

Because you have two options, either you design stuff in way where they are fully functional no matter what hand you write with. Or you design stuff in a way where you need separate models for left handed and right handed. The key is that you either design stuff to be universal or you have models for both groups.

New blogs

22.01.2018 01:00

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.

Spacemacs

22.01.2018 01:00

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.