All Blogs
Written by Kiprosh, team of passionate and disciplined craftsmen turning your ideas into reality.
Kiprosh
is now part of
LawLytics
Written by Kiprosh, team of passionate and disciplined craftsmen turning your ideas into reality.
Issues with Daylight Zones and How to handle them. Background of RV Tasks: In Realvolve app, we had Tasks(Something that needs to be done), Also we had Repeating-Tasks(Something that needs to be to done at regular interval). Normal Task: had one occurrence as its a one-time task. Repeating-Task: had many occurrences, for which we need to track status of occurrence. Ex: Repeating-Task: Attending classes for 60 days continuously. Here there are 60 occurrences for which we need to track status like completion(Attended class). Now, let's dive in Time-zone issue related to daylight. Don't know DST? follow the
How to work with time-zone in rails Time-zone leaks: This is an issue where time-zone of one request is passed to another request. Ex Scenario: Lets say we have web-server running on a single dyno and we have three different users with different timezones('Mumbai', 'Central America' and 'London'). Here is my code setup that will produce time-zone leaks, class UserController def method_one_with_time_zone puts Time.zone #before_filter sets the time zone for this method execution. end def method_two_without_time_zone puts Time.zone #This method doesn't call any before filter, So it will
Timeago is a widely used jQuery plugin which makes it easy to support automatically updating timestamps. (ex: 2 minutes ago) plugin documentation: http://timeago.yarp.com/(link) Now we will see how to integrate timeago jquery plugin in ember application. (Here we will give example using ember-cli) install jquery-timeago plugin using bower bower install jquery-timeago In Brocfile.js app.import('bower_components/jquery-timeago/jquery.timeago.js'); Create Ember Component to display time format app/components/time-ago.js import Ember from 'ember'; export default Ember.Component.extend({ timeValue: new Date(), didInsertElement: function() { Ember.$().ready(function (){ Ember.$('time.timeago').timeago(); // update every
Recently, in one of our in-house app, we faced issues with RSolr that failed all our builds in CircleCI. We faced following RSolr specific errors in our CircleCI builds for the repo. RSolr::Error::Http: RSolr::Error::Http - 500 Internal Server Error Error: Severe errors in solr configuration. Check your solr log files for more detailed information on what may be wrong. If you want solr to continue after configuration errors, change it to following configuration instead of null <abortOnConfigurationError>false</abortOnConfigurationError> After troubleshooting and debugging, we noticed that our repo in git just had
Apipie-rails is a DSL and Rails engine for documenting you RESTful API. Instead of traditional use of #comments, Apipie lets you "describe the code by code". This brings advantages like: It uses ruby syntax Reusable doc for other purposes (Best for validations) Easier to extend and maintain apipie-rails gem owner has documented it in very nice way with examples. Refer [Github Documentaion(github doc)][1] Path to documentation: The documentation is available right in your app (by default under "/apipie" path.) Also you can provide your own path using initializers. For more information refer [here(config
For displaying flash messages and other informative messages, we generally use Internationalization (I18n) in rails. Sometimes we also need to write similar messages again in javascript/coffeescripts which can be difficult to manage if these message changes. And also it doesnt follow the concept of DRY. To follow DRY, we need to make rails locales available in javascript. One way to do it is to declare a global variable and have all locales saved to it as Javascript Object. This is what we did in our project: Added following code in application layout: For HAML - window.I18n = #{I18n.backend.
If we need to support additional parameters for devise authentication besides normal(username/email with password). We can do this in devise by overiding an existing method, 'active_for_authentication?'. After authenticating a user and in each request, Devise checks if your model is active by calling model.active_for_authentication? Consider a feature 'Lock sub user', here we can add a boolean flag 'is_locked', based on this flag we enable or disable the authentication for the sub-user: def active_for_authentication? super && !is_locked end Instead of !is_locked, we can also add a custom method which:
Spec Improvements We were fixing some failing specs in one of our project, we noticed beside failures the spec timings was too high. We spent time not only to fix also improve the performance. During this process we learned few good practices and removed bad things we added earlier which helped us improved the performance. We had good amount of setup code for specs, for which we were using let statements. We can move the setup into a before(:all) block, replacing lets with instance variables. This will create the data only once, and as long as we never change
Ember is awesome but it will take some effort to get started with. Here I would like to share collection of getting started resources to make thing easier for those who trying to learn. Introduction: Building Web Applications with Ember.js – Yehuda Katz has explained very nicely that how Ember can be used to build fast and responsive apps, and also shared some nifty aspects of Ember you might not know about. [http://www.youtube.com/watch?v=u6RFyVN9sNg(video)][1] Basics: Ember Guides – This is the official documentation provided by ember.js developer team. It has everything explained explained
What is Push Notification ? Push notification is a feature that allows an app to notify user of new messages or events, even when the user is not actively using your application. Like on Android devices, how a whatsapp message will make a sound and icon appear in the status bar. What is Apple Push Notification service(APNs) ? "Apple Push Notification service" is the service for implementing the push notification feature for IOS devices. How it works ? Each device establishes encrypted IP connection with the service and receives notifications over this persistent connection. If a notification for an application