If you’re here, I assume you already know about the PaperTrail gem. If not, check out its official Github page. It is the leading Ruby gem for ActiveRecord versioning. It can help us to see how a model looked at any stage in its lifecycle, revert it to any version, or restore it after it […]
Technical
Jmeter + Maven Integration – Some facts
JMeter is the most widely used open source tool for analysing the performance of different applications. Here I will be discussing not only how we can “integrate” JMeter with Maven but also discuss what common “hurdles” we usually encounters with the integration. Maven basics are required to be known, to understand following discussion. So lets kick off this […]
Leveraging the power of RxJava in Android Apps
Travel Triangle is committed to providing a delightful experience to travellers, starting from choosing the right destination, customising their holiday experience and providing on-trip assistance. To this end, we launched our Android app in early 2015, given the increase in number of users accessing our website through mobile devices. Since launch, our Android app has […]
Rails PaperClip integration with Cloudinary Fetch API in a smarter way
In our application, we have been using Paperclip with Amazon s3 for image management. We chose Paperclip as it can integrate with ActiveRecord seamlessly As it treats files like simple record attributes. It is used extensively across our products for various use cases. From a volume perspective we serve over 4M image requests per day. […]
AUTO – DOCUMENTATION (Chrome Extension)
Before getting into technicality of AUTO-DOCUMENTATION, I would like to share the motivation behind creating such solution. There was an instance in regular sprint, where QA team was struggling with the bandwidth, due to lot of company critical projects in hand. After analysis we found out that lot of the time had been spent in […]
Paperclip upload image via console
It is very easy to associate an image with a model using ruby console, given you are associating image to the model using paperclip. Here is what you are gonna do url=”http://golygon.com/image_url.png” file = open url //Ruby will fetch the image using HTTP on your server @user.photo = file // User model uses paperclip to […]
Rails Tips – Counter Cache (.size vs .count)
* Size (rails function) is more intelligent than count (ruby function) * Notice that when you counter cache, size makes only one call to db as opposed to count which does 2 queries. 1.9.2-p320 :057 > ParentModel.find(5765).childmodel.count RequestedTrip Load (0.3ms) SELECT `parent_models`.* FROM `parent_models` WHERE (`parent_models`.`id` = 5765) ORDER BY parent_models.created_at desc LIMIT 1 SQL […]
Sphinx – A Use case with Rails 3
Sphinx is open source search server used for full text search, we have used it with Rails and MySql database. Why Sphinx: Blazingly fast indexing and searching Variety of Text Processing features which are easy to adapt as per Application. Scalling: It can scale up to millions of queries per day. Performance: Sphinx indexes up […]
Rails – Speed up Server Start Time
I use Amazon EC2 infrastructure to run my Ruby on Rails application and lately the load time for my application has gone in minutes, actually couple of minutes. After some googling I realized that it does not matter much if I have lots of models and controllers in my code. Most of the time consumed […]
Virtual Touring in Google Maps with Play/Pause feature
Source code and sample html available at: https://github.com/prabgupt/googleMap_virtual_tour Usage: Mentioned in README present at git repo above Purpose of Plugin: You can display virtual tours between places on map. Currently, above sample show animation of marker moving along actual direction path between places located on map in sequence specified. Prequisite HTML, jQuery/JavaScript knowledge is required Basic […]