I’ve recently become truly interested in making my lifestyle healthier. It wasn’t because of any health problems, I was just curious about habits that could help me avoid any future health issues.
The world of health advice can be a very confusing place. If you ask ten experts about a health topic, all ten of them may have completely opposite opinions. My goal was to find advice that most health experts agree on and make a guide that I wish I had found when I started exploring how to become healthier.
Disclaimer 1: I’ve put a lot of effort into verifying all the information and sources, but I’m not an expert on nutrition or exercise. If you have any health conditions, please consult them with your doctor, nutritionist or physiotherapist. Do use your common sense to judge everything in this article (and everywhere else too for that matter). …
GraphQL makes building APIs a breeze. Just define types, resolvers and mutations and GraphQL takes care of the REST 😏 ActiveRecord, the most popular Ruby ORM, is famous for its N+1 queries problem unless you correctly preload associations. Can we make ActiveRecord work with GraphQL efficiently without annoying boilerplate?
Imagine the following GraphQL schema.
class ArticleType < Types::BaseObject
field :id, GraphQL::Types::ID, null: false
field :title, String, null: false
field :description, String, null: false # Article belongs to author so Article#author
# can resolve the field.
field :author, Types::AuthorType, null: false # Article has many and belongs to many tags through
# a joining table so Article#tags can resolve the field.
field :tags, [Types::TagType], null: false
I'd been a happy Ruby on Rails developer for years when I started playing around with SPAs. Server-rendered HTML with sprinkles of jQuery worked well for most of my projects, but some parts were getting too complex. That's when my React journey began.
React with Redux was the most popular SPA combo at the time and I gave it a try. Well, the amount of boilerplate that Redux required really sucked. Having been used to Rails, everything seemed 10-times more complicated than it had to be and I couldn't see too much of added value to make up for it. I had a feeling that I would rather deal with occasional jQuery spaghetti than write all the Redux bullshit. …
The summer had just started and I was finishing the day in my office in Bratislava (Slovakia). For a few months, I’d been working remotely on a project for an American client. We’d just launched its first version and the client was talking enthusiastically about its first users. Then he brought up an interesting question about my take on relocating to New York.
Well, I had no idea if I wanted to move to New York permanently. I was also quite used to my lifestyle back in Bratislava — friends, parties and sometimes work (just kidding, a lot of work). I was sure, however, about one thing. I definitely wanted to visit the Land of Opportunity, speak a lot of English and meet my co-workers in person. …
It's been almost 3 years since I graduated and I'd like to retrospect the things I learned as a student. Are you considering a university? I might motivate you. Are you a self-taught developer? I might give you some ideas on what to learn to catch up with the developers with more academic background.
Caveat: The article is highly subjective — every person, life situation and university is different, so take it with a grain of salt. It's meant to be an inspiration, not the general truth. …
I've been writing tests for Rails apps for over 5 years. I've come to a conclusion that well-written test suite makes developer more productive in the long term. The idea is to strike an optimal balance between not testing at all and writing zillions of tests. But where is this sweet spot?
More tests mean more code to write and maintain. So why do they make us more productive?
A few years ago I spent one semester as a foreign student in Madrid. The experience inspired me to travel more and after graduating I moved to Manchester. I had an ambitious plan to stay for a few months in each major European city. It was in Manchester that I realized all the European cities looked similar and it became more appealing to experience cultures around the world rather than just Europe.
So how did I come up with Nicaragua and Costa Rica? During my stay in Madrid I picked up two little hobbies of learning Spanish and dancing Salsa, so I chose Latin America for the first experience-cultures-around-the-world trip. South or North America? Well, how about a compromise — Central America? Still many countries. I had a few friends from Nicaragua and they recommended me their country for its safety and low prices. …
I had a chance to work on a project that used friendly_id. The gem was mostly great, but there were a few situations when it didn’t work as expected and I spent hours fixing it. I’m not a fan of reinventing the wheel either, but for my latest project I tried to implement SEO-friendly URLs just with what Rails has to offer. It turned out really easy and with many advantages over the gem.
There are two common requirements for SEO-friendly URLs:
In spite of learning English for almost half of my life, watching all movies in English and listening to English music, I had a hard time speaking with native speakers. Then I started focusing on my pronunciation and things suddenly improved.
So why is English pronunciation so difficult?
A lot has been written about React and I’m not going to explain the same things again. If you are new to React, read the home page of React to get an idea (make sure you understand the examples). …