Why the struggle to be better for others?

Why do we feel guilty when we don’t help and do something for others? Ignoring that friend’s message when we know he needs us but we don’t have the energy for it. When we promised to do something for someone, but those dishes really need washing. The time to do it is there, but we just can’t be bothered to get it started. When there is no obvious benefit for us. Continue reading

Facebooktwittergoogle_plusredditpinterestlinkedinmail

The women’s day

Every day is women’s day, but today we get to be reminded of that!

I believe that women are strong, enduring and often wiser than men. I have seen this in the women in my life, in fact, they have taught me what it means to persevere, to work hard and with dedication. To love, but not the selfish “love”, rather the one where you are ready to give everything away for your love.

With the greatest respect and appreciation, happy women’s day! You make us better, keep smiling, forgiving and loving!

Special thanks and best wishes to my mom, my sister, my grandmothers and my dear better half.

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Annual Plan 2018

Reviewing 2017 made me appreciate what worked throughout the year. It also exposed a few places where things didn’t go as I wished, which is OK, but I hope to improve them this year. Overall, last year was great in from my experience and I hope this one will go similarly. Continue reading

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Cycling around Iceland – Plan of days and distances

I have read a lot before starting my trip in Iceland, but I struggled to find useful information about a reasonable daily itinerary to go around the island at a reasonable pace.

There are many ways to cycle in Iceland, but yet not as many as in other countries. The roads are few and the good tarmac ones are even less (yet still better from what I read than 5 years ago). The reality is that if you want to cycle around the whole island there are (with few exceptions) only two options. To cycle on road #1 clockwise or counterclockwise. You can extend or shorten the trip by avoiding or adding to your journey the:

  • Snaefellsjoekull National Park peninsula
  • North-Western fjords
  • Coastal line in the North-East (from what I’ve read the roads are poor in the very North-East tip of the island)

Here is my initial plan for going around the island in 18 days. You can shorten the trip by linking the shorter days into single days. I think it will be harder to extend the 18 days to more unless you wild-camp as there is little in between the locations mentioned.

Day km Place
Day 1 ~50 REYKJAVÍK ECO CAMPSITE
Day 2  ??? AKRANES CAMPING SITE
Day 2 112 BORGARNES CAMPING GROUND
Day 3 78 Hotel Edda Laugar Saelingsdal
Day 4 128 Blönduós Camping Grounds, Gladheimar
Day 5 143 CAMPING SITE HAMRAR
Day 6 93.6 Husavik Campground
Day 7 54.5 Bjarg campsite
Day 8 166 Egilsstaðir Campsite
Day 9 92.3 BREIÐDALSVÍK CAMPING GROUND
Day 10 64.2 DJÚPIVOGUR CAMPING GROUND
Day 11 104 Hofn Camping and Cottages
Day 12 ~130 N/A – Tjaldsvæðið í Svínafelli
Day 13 ~75.8 Camping Site and Cottages Kirkjubær II
Day 14 ~102 Skogafoss
Day 15 110 Tjaldsvæði Campground
Day 16 111 SOUTHCENTRAL MOTEL
Day 17 90.1 GRINDAVÍK CAMPING SITE
Day 18 47.1 N/A – Keflavik International Airport

For the sake of presentation I’ve reduced the information in the table, but if you want to see the original table with contact information, notes, etc., please follow the link below.

See the original google spreadsheet

Please note that I didn’t actually follow this plan to the note (as you can see by the posts I’ve been doing on the trip), however it was a very good baseline for me. I am sharing it in the hopes that it will be of use to others as well.

Subscribe to receive the next post in your mailbox

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Callbacks VS Promises – Differences – Simple Notes

I thought to discuss simply the differences between callbacks and promises in JavaScript and why promises are becoming so popular.

The classic callback pattern

This is a very standard callback pattern. You work with the data and when done you call the callback function.

In the callback you check if there is an error and if not, you process the success. It works and has worked for a while, but there are a few problems with this pattern.

First, you have duplication by having to call the callback function for both a success case and a error case.

Second, you have one function handling multiple cases – the callback has to manually check if there is an error and handle it. Every time you need to manually do that and the code starts to look messy and confusing the more you add.

Third, you can end up (for whatever reason) calling the callback function multiple times for either success or errors. This can cause all sorts of issues.

Promises

In promises it works similar to callbacks but we start by actually creating a new Promise();. Promises take two parameters – resolve and reject to handle respectively success and error cases.

You can call each only once and this is a much cleaner way, there are no assumptions (“undefined” means error).

Next, the promise function is called and it has a method available called .then(); The first parameter of .then() always handles the success so you know you will receive whatever you were expecting (in this case our JSON object “data”). The second parameter of .then() handles fails, hence the “error” is passed to receive the respective error.

You could achieve this pattern yourself as well, but promises provide a secure and intuitive way of handling callbacks.

Conclusion

Promises are great as they provide an easy, simple and secure way to handle callbacks in ES6, that is readable and just makes sense. If you want to read more on promises, check this article by Jake Archibald on developers.google.com.

Subscribe to receive the next post in your mailbox

Facebooktwittergoogle_plusredditpinterestlinkedinmail