hjertnes.blog

#

11.12.2017 01:00

Charging the iPhone 8 Plus

11.12.2017 01:00

It takes forever to charge the iPhone 8 Plus using the charger and cable you got with the phone; and it is a little bit better if you use a iPad charger. But it still takes a very long time.

But, you can get faster charging if you take one of the Apple MacBook Pro USB C bricks and plug one of the LIghtning to USB-C cables into it. My impression is that it charges around twice the speed.

Which brings me to my point. Why can’t Apple start to bundle better chargers with their devices? Or at least a cheap version of their current chargers with USB-C instead of USB-A. To charge using the USB-A cables is horrible. It takes forever. It is bad user experience to wait longer.

I get the margins argument, that people use every time someone thinks Apple should do better. And, yes, I get that. But I just want Apple to start moving in the right direction. Because if Apple comes out with phones with bigger and bigger batteries, the charging over USB-A thing will become a joke.

If you want faster charging: get a MacBook Pro power brick (the 13 inch version is good enough) and a Lightning to USB-C cable.

React

11.12.2017 01:00

One of the first things I wrote down in my notebook as I was planning or trying to figure out if there was enough stuff to write about to do this site was a React introduction. I know React fairly well, and have been working full time with it for quite a while now. I’m not sure how many things there will be to write about React. But I assume there will be a few weeks with React related content.

I’m going to start with basics and then move on to more advanced topics and try to cover the different aspects one have to consider writing an React app. This will also be a excellent opportunity for me to learn the various parts of React I personally don’t use.

The goal at the end of this small or large series of posts will be that you know everything you need to know to build from small apps to large apps; with or without server side rendering.

Thick vs thin notebooks

11.12.2017 01:00

I have used very thick notebooks, and I have use very think notebooks; everything between the Travelers Notebook refills to huge A4 notebooks with around 500 pages.

There are good and bad things about both and everything in between. These days I tend to prefer the ones in between; like the hard cover Leuchtturm1917 A5 notebooks. Because I think they are the perfect compromise between not taking a lot of space and being very heavy and being too expensive because you run through a lot of notebooks.

The good thing about smaller notebooks is that they are small, you can fit them almost everywhere and they are not very heavy. Perfect examples of this are pocket sized notebooks like Field Notes and both versions of the Travelers Notebook; I always go with the latter if I want a notebook but don’t have a lot of extra space. While the good thing about the huge notebooks is that you get a lot of notebook for your money because there are more pages to cover the cost of the cover, than if you have smaller ones.

What’s right for you? Well, it depends on you. I would try out different M-x postformats. And different formats will probably be good for different I use the smallest possible notebook (a Nock.co pocket sized one) for writing lists on the go, and I keep my journal in a Travelers Notebook because the think refills and soft cover makes it possible to always have it with me. But when it comes down to task management and drafts of larger texts I prefer Leuchtturm1917 A5 notebooks; enough pages that they last for a long time but small enough to not be a hassle to bring with me every single day.

I have come to this conclusion after trying out more or less every single format available over many years, and tried them out for different kinds of use cases.

The process of figuring out what works for you is something I personally think is very valuable, because it is the only way to find the best options for you. And I always try to identify when something isn’t working anymore.

#

10.12.2017 01:00

I’m fairly happy with the experience of moving over to Lightroom CC this far. Uploads are as fast as I let them to be. And dealing with CC is far less complicated than Classic. No options during import and the previews are hidden under the hood.

There is also a downloader for those of us that want to make backups.

#

09.12.2017 01:00

My first impressions after being in the process of importing all of my raw files into Lightroom CC is that it is that I wish LR was when I got started with it. It might not be what most power users want. But it looks promising.

#

08.12.2017 01:00

I think the basic premise of MeeToo is a good one, but what I don’t appreciate is the lack of understanding between the difference of harassment and sexual harassment. It seems to me that all harassment are treated as and discussed as the same.

Adding stuff to the prototype.

08.12.2017 01:00

So, you have written a neat little utility function to do something with for exampel arrays. That you are going to use all over your React app.

I’m not going to start a religious war there, but you should read this before you start adding stuff to the prototype of objects you don’t “own”.

Let’s say you have written a method called “found” because you don’t know about “find” or because you prefer to get back null instead of undefined. I’m not saying this is a good idea, I would go as far as to say it is a horrible idea. But my point here is mearly to show what is possible. Extending the prototype is a powerful tool though, useful to work around browser bugs or to get around limitations of older browsers.

You could do something like this:

The problem with this is that then you need to import this function (or even worse copy paste it) into each place you need it. Another way to solve this would be to add it to the Array prototype:

There are many reasons to why you shouldn’t do this. The main reason is what I call the jQuery plugin problem: what if two pieces of code extend the same object to the same value. For exmaple, what if you use a plugin that extend the prototype by adding to the same name, but works differently?

Summary: a very powerful and useful trick to have up your sleeve, but it might not be the best to use it on objects you don’t “own”.

Iterators

07.12.2017 01:00

An iterator is the underlying structure of arrays and everything else you can loop over using for example for-of. You probably don’t need to implement one yourself, unless you are trying to make something that is Lazy. A lazy iterator is when it continues to iterate as needed.

The basic idea is that you add a symbol (I’ll add a example below) that returns a object, with a next method, that returns an object with two keys: value and done; done is a boolean telling the code that iterates over the iterator if it is the last element or not.

#

06.12.2017 01:00

I’ve been very skeptical about Lightroom CC; especially about not having a copy of the images locally. But I think I’m going to give it a shot, now that I have enough bandwidth to do it. But, first I need to find out how to back it up.l