Fatos Morina

Software engineering and personal development

Moment is a lightweight JavaScript library that helps you work with dates

Img source: christosfellas.com

One of the best JavaScript libraries for working with dates is moment. It is really easy to install, use and has many functions that help you with parsing, validating, manipulating and formatting dates.

Continue reading

Find out which gems are consuming the most of your memory with Derailed

Img source: blog.honeybadger.io

Rails gives you a lot of great ways for rapid development, but there comes a time when your application is already mature and needs to be optimized, because it has become slow. The more gems you add to it, the slower it tends to get. Each gem you add in your project will increase the level of RAM this app consumes. Here is a gem called derailed that can help you learn about other gems, developed by Richard Schneeman.

Continue reading

How to write complex queries using Globalize gem in Rails applications

Img source: railscarma.com

Globalize is one of the most famous gems that is used for translating dynamic content in Rails application. It is really easy to use, and brings a lot of conveniences immediately after you add it in your application. I recently had to do a more complex query using the table added by Globalize generator, and I could not find that much information about ways of doing joins for this newly added table with the one that it corresponds and that translates its attributes. In this article, you can see a short example on how to do that.

Continue reading

Rename Rails controllers, views and migrations with Rails Refactor

Img source: https://www.youtube.com/watch?v=-sX05s0STs8

There can be cases where you wished you named that controller a lot better, as it does not make any sense and is very ambiguous in its current form. If you have ever wondered whether there is a way for you to do quick renamings of multiple related files inside a Rails project, then I have some good news for you. There is already a gem called Rails Refactor, that can be used to do these renamings. Continue reading

Add translations fields in RailsAdmin using rails_admin_globalize_field gem

Img source: Gem’s Github page

In the last post, we saw how we can translate a variety of dynamic contents that we may have in our Rails applications using globalize gem. There is another complementary gem to globalize that can be used to do these translations inside Rails Admin, which make it a lot easier and simpler to insert these translations inside RailsAdmin’s user friendly interface.

Continue reading

Translate dynamic content using Globalize gem

Img source: railscasts.com

We are in an interconnected world, where people across the planet can use the projects that we develop, and having the opportunity to offer them with additional international languages make them a lot better. We can obviously use locale for doing the translations of static strings like labels, or placeholder descriptions that appear across our applications, so we should also have something that can give us a way to translate the dynamic content.  There is a really great Ruby gem that makes the translation of model attributes a lot easier. This gem is called Globalize and is very easy to use.

Continue reading

Set up your macOS development environment using Thoughtbot’s Laptop script

One of the things that may prevent us from changing or even just thinking of changing our working environments is the necessity to do all the installations and the configurations that we once set up that are needed for software development. Fortunately, there is a cure for this pain. Laptop is a script that prepares your working macOS machine for web and mobile development.

Continue reading

Jump between words using keyboard shortcuts in iTerm

Img source: iterm

iTerm is a really great terminal replacement that I really like to use. One feature that I wanted to have after my migration from Windows to OS X is the ability to jump between words in the command line, and not having to go through the whole line character by character. It turns out that this is possible quite easily and without much pain and effort from your side. You do not need to pay 1 BTC to Apple to get this working. You only need to make a few keystroke changes in your iTerm preferences and you are done. Continue reading

Resize your apps’ windows in your Mac like in Windows using BetterSnapTool


Img source: itunes.apple.com

For a very long time, I have used Windows as my default operating system. A couple of months ago, I switched to Mac OS and a few features that I really enjoyed having in Windows were not in this new OS. At least, not included by default. One of them was the ability to resize the windows of applications by dragging them to one of the screen’s corners. Fortunately, I saw Noah Kagan recommending a cheap app called BetterSnapTool, which allows you to do just that. Continue reading

Create great database schemas very intuitively using DBDesigner

Img source: red-gate.com

One of the most important parts of developing a project is the necessity to have a clear picture in mind about the end goal. Namely, knowing the target audience that this project has and the features that it will include. This means that we need to make sure we are informed as much as possible about the business logic, and then be able to do the implementation of all the features as needed.  Continue reading

« Older posts

© 2018 Fatos Morina

Theme by Anders NorenUp ↑