Using Postgres’ Hstore datatype in Rails

HStore is a key value store within Postgres. You can use it similar to how you would use a dictionary within any other programming language, though it’s specific to a table column in the database.

I use Hstore when I need to combine the functionality of relational database (SQL-based), with non-relational databases (NoSQL databases) in one project. For example, if you are creating a databse for an online electronics store, you will need a relational database, to save the customers, their orders, and the products they ordered. However, the products themselves don’t share the same attributes. (i.e. memory cards have memory size but laptop chargers don’t, and although it’s suitable to have number of HDMI inputs for a TV, it can’t be applied to earphones.)

You get the idea.

Continue Reading

Remove .DS_Store files from git

This tutorial will show you how to remove those annoying Mac OSX .DS_Store files from a Git repository.

.DS_Store is a file that stores custom attributes of its containing folder, such as the position of icons or the choice of a background image. The name is an abbreviation of Desktop Services Store, reflecting its purpose.

The file .DS_Store is created in any directory (folder) accessed by the Finder application, even on remote file systems mounted from servers that share files, for example via Server Message Block (SMB) protocol or the Apple Filing Protocol (AFP).

The problem with .DS_Store files is that they impose additional burden on revision control process: They are frequently changed and therefore appear in commits, unless specifically excluded.

Continue Reading

Public Announcement

Developers do not, shall not and/or should not work for free.

And there is no such thing as “just do this tiny thing”

I do charge for my services (huge, small, or even tiny) what I believe to be a reasonable fee. You don’t like that? The market is full of other developers who probably are better and cheaper than me.

Continue Reading

Push git to multiple repositories simultaneously

All developers that use GIT as a way for version controlling should know how essential is it sometimes to push your commits to different remote repositories. whether for backing up or to submit your work to different destinations.

In this post, I will be explaining how to push your GIT repository to multiple remotes simultaneously with one git push command.

Continue Reading

Mobile app or responsive website?

It is 2015. You know your business (or your blog, portfolio… etc) needs a mobile presence; but then this question is raised: “Mobile app or Responsive website?”.

And to be honest with you, I may have accepted this as a question a couple of years ago. Now in 2015, everything is moving — with very fast paces — to a mobile world that changes the question to become “Should I build a mobile application or is a responsive website enough?”

Continue Reading