Redis - make it your best friend

Performance is always a headache in web development. Sooner or later in the life cycle of your application, you will need to tune up the app to make it run faster, to be able to serve more users simultaneously or just to make sure it does not eat up all…

Advanced Regex: Power of lookahead and lookbehind

We might have been using Regex in all sort of tasks like splitting, replacing or matching strings. But you might not know one powerful feature of Regex which can really help you in many cases that you thought Regex is impossible. And today, we are going to talk about lookbehind…

Using git bisect to find bad commit

Today, I am going to introduce a technique to easily find out the first bad commit in your git repository. With this technique, you can save a lot of time debugging a code introduced by certain commit. Let's get started! First, assume that we have the following commits in our…

Customize File upload control

Unlike other form controls such as textbox, checkbox or radio button, you'll find it hard to customize file upload control. The look and feel of this control is totally managed by the rendering browser. A simple customization like changing the button color or remove the text "Choose a file" seems…

Skip ActiveRecord callbacks

Callbacks are great and many business rules are often implemented in those callbacks to maintain data consistency and perform useful actions in app. As you might know, we can define several kinds of callbacks in ActiveRecord model, refer to the following guide for more detailed information: http://guides.rubyonrails.org/…

Correct configuration to fix CORS issue with CloudFront

If you are using CloudFront for hosting static assets and having trouble with the CORS which prevents the icons from displaying properly on your website, in this post, I am going to show how to resolve this issue. As you have already known, the main cause of CORS issue is…

Gem Idol: Friendly Id

This week, I would like to introduce a gem which is being used in almost every project I have been working on. And it becomes more important for us nowadays because everyone want their website to be SEO efficiently. Link: https://github.com/norman/friendly_id Developed by: Norman Clarke…

Custom dialog for data-confirm in Rails

Every Rails developers might be already familiar with data-confirm attribute for a link. It is used to ask for user confirmation before executing the action on behalf of user. Here is one example <%= link_to "Delete", post_path(post), method: :delete, confirm: "Are you sure?" %> The generated link…

Gem Idol: Figaro

Today, I really want to start something different which I believe would be very helpful to new Rails developers. I remember the time when I first came to Rails world, I was impressed with its amazing community and gem ocean. I could find almost every thing I needed which has…

Running Faye server on AWS ElasticBeanstalk with Load Balancer

One of the amazing features you want to build in your application is the ability to deliver content to users in real-time without requiring them to refresh the browsers. You can achieve this by sending requests in fixed interval to the server to get changes or you can have a…

Several tools to monitor your Rails application

After your Rails application is deployed to server, there would be tons of things could happen to your app which you have never expected when running the app in your local environment. In that case, you definitely want to have a tool to support you monitoring the application and quickly…