hjertnes.blog

Workflow and Pythoninsta.

13.11.2017 01:00

I was looking into how to do something really simple using Drafts and Todoist on Saturday.

The basic idea was that I wanted an easy way to either add or create a new project and then add a series of tasks to it. (First line is the project, and the rest is tasks).

Well. I thought, this is a perfect opportunity to play around with Workflow. So, I made the damn thing and then I also did it using Pythonista.

The verdict? It took way shorter time using Pythonista because I know how it works, but I think something like Workflow is the right tool, if you don’t know how to code.

This is a common thing I often see myself doing. When something is very simple, I almost always end up writing it myself, because then I don’t need to learn all the “jargon” and metaphysics every single system always have.

The difficult thing is to know when to write it yourself, and when to learn what is already there.

#

12.11.2017 01:00

#

12.11.2017 01:00

Anyone tested out Lightroom CC?

#

11.11.2017 01:00

#

11.11.2017 01:00

#

10.11.2017 01:00

The only way to make sure I see everything going on at Micro.blog I have found so far, is to add my timeline feed to Feedwrangler.

Understanding the difference between functions and arrow functions

10.11.2017 01:00

Most React components are written something like this

```text I personally think this is very verbose, compared to what it has to be. Because just because most people use regular functions inside their ES6 classes, doesn’t mean you have to. You might disagree, but all the methods I define inside a component should either be moved to some utility file or they need to interact with the components ‘this’.
The way I write React Components these days, if they aren’t stateless, is written something like this: ```

```text The big difference between the two is that I have ditched the constructor, because I’m only using it to set the default state and binding the functions. Then all the methods in the previous class have been replaced by arrow functions that use the expression syntax. Which removes some lines with brackets and a return statement.
I personally think the latter versjon looks a lot better; or at least a lot cleaner. There are less "stuff". And I’m going to start re-writing a lot of react code to follow this form, and everything new I write will follow this form. I could probably remove many hundred lines of code just in removing brackets, return and unneeded binds and constructors in my work projects. ```

#

09.11.2017 01:00

Just got my my new Apple Silicone case for my 8 Plus. It looks good, feels good, adds protection without too much bolk.

I personally think that Apple makes the three best cases for iPhone. The Silicone and the Leather Case is without doubt the best general case, and the Smart Battery Case is awesome; if you want a battery case.

Most of the cases I see out there looks pretty bad. Big and or ugly.

When it comes to the case or not question, I think that there was no need for a case, unless you needed extra battery before the 6 and 6 Plus.

But I think you need one with anything larger than a 5. And the fact that Apple makes cases for them, and not the 5 size or smaller speaks for itself.

You can blame it on the size or how slippery they are. But the larger phones need a case.

I used a red silicone case on my iPhone 6S Plus, until it fell apart, and then I used a leather case until the phone died.

And I ordered a new silicone case a few days after I got my new phone. I didn’t really consider anything but a Apple case, because they are the best.

Javascript is not syncronous; don’t treat it as such.

09.11.2017 01:00

I get some StackOverflow thread named “How to do”Insert what I Googled for here” syncronous” every single time I google anything generic about Node. And while I do understand the question, I think they are asking the wrong question.

```text Node is awesome when you let node be node, and it is horrible when you try to treat it like for example Python or Java with Javascript syntax. Because node is async while Python and Java is sync. This means that everything that might block the main thread will be spun off as its own thread, without you telling it to do that. And then you have to either deal with it through callbacks or promises. ```

```text The reason you want this is that you don’t want your web server to be unresponsive while you are executing a huge database query, or your web app to be unresponsive while you are doing a very heavy filter. ```

```text I have seen some developers that I have worked in the past treat Node as something it isn’t. And I told them time after time after time to use Promises or callbacks to deal with what they were doing. Because what you are doing here will never work well. They aren’t terrible developers, most of them are actually execellent, but they aren’t that great with Javascript. And were always talking about rewriting it, instead of doing a trivial change, because they didn’t understand it or what ever. ```

```text You have two options if you don’t want to write callbacks; either as in callbacks or as in dealing with promises. Use something else than Javascript or use async await. It will let you write code, as if it was syncronous while still being asyncronous. ```

```text Node and Javascript makes it very easy to write high performing async code. But you need to embrace that it is how it works. And stop to think like a Python programmer. ```

#

08.11.2017 01:00

I always think “has Facebook a new authentication system?” when I see FaceID