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.
In my previous knockout.js post, I just gave introduction and explained how knockout works. We learnt about how knockout uses bindings to make UI dynamic and how it connects to the view model In this article we will learn custom binding. There are built in bindings like click, value, text, visible and so on. But you are not restricted to use only those binding , you can create your own custom binding. It’s always better to create custom binding for DOM elements instead of writing jquery. Advantage of creating custom binding is, you can reuse it for any number
In one of app we are sending multiple PDFs as attachment, so instead of sending individual file we decided to send all PDFs in zip. I found a gem 'Rubyzip', to create temporary zip archive and send it as attachment. Rubyzip is a ruby liabrary to reading and writing zip file. To create a zip and send it as attachment using Rubyzip here’s a simple example: Add gem in gemfile gem 'rubyzip' Write function to create zip file: def get_zip_data zip_file = Tempfile.new("example.zip") file_names = ['demo1.png', 'temp1.txt', 'temp2.pdf'] file_
Traditionally web applications were dependent on back end for routing as A request is made to a server and based on the URL being requested the server responds by HTML.But now a days due to advanced browsers and need for speedy response more advanced code started being moved from the backend to the frontend. Sammy.js is a tiny(Above theory is good for starting so now lets move on with example of sammy js using type script. public addRoute(url: string, action: (context: Sammy.EventContext) => void) { this.routeTable[url] = action; } Above is the typescript method which take
In this article I am going to show how to write model attribute and computed property test cases for ember applications. I have been writing test cases from couple of days in GoodCity ember app. I will takeDesignation model as an example model to write test cases. Designation model has shown below. models/designation.js import Ember from 'ember'; import Model from 'ember-data/model'; import attr from 'ember-data/attr'; import { belongsTo, hasMany } from 'ember-data/relationships'; export default Model.extend({ status: attr('string'), createdAt: attr('date'), recentlyUsedAt: attr('date'), code: attr('string'), activity: attr('string'), description: attr('string'), detailType: attr('string')
NSDataDetector There are many application that extracting specific desired information from a string like date, url, link, address, number and many more. Using this specific desired information we can perform many useful action like create a event, open a url, save a contact number, navigate to particular address. Example The NSDataDetector class can match dates, addresses, links, phone numbers and transit information. NSDataDetector will be return one of the data detectors type, depending on the type of result being returned and they may have different properties. For example, Result of type link have have a url, result of type date
Spoiler Alert: This article is not about Microservices architecture or how microservices works. In this article, I will share what we have learned in scaling one of the large SaaS platform, our ongoing improvements and how Microservices architecture is playing a key role in scaling this SaaS platform. This SaaS Platform has experienced tremendous growth in the past 18 months. It has now become one of the leading CRMs in North America. Everyone’s definition of “scale” and “growth” can differ based on specific numbers or metric a company is targeting i.e. revenue, user base, or others. We are
If you want to show users gravatar profile picture in your rails application this article may help you Its very simple to use gravatar image in rails application by these simple steps We need to create a helper method that returns Gravatar image for given user in your app/helpers/users_helper.rb as shown below module UserHelper def user_gravatar(user) gravatar_id = Digest::MD5::hexdigest(user.eamil.downcase) gravatar_url = "http://secure.gravatar.com/avatar/#{gravatar_id}" image_tag(gravatar_url, alt: user.name) end end Gravatar URLs are based on an MD5 hash of the
The Contacts framework provides Swift and Objective-C API to access and create a new contact. This framework is optimized for thread-safe, read-only usage. The contact class (CNContact) has a mutable subclass CNMutableContact for use to modify contact properties like phone numbers, email addresses, an array of CNLabeledValue objects. CNLabeledValue contain label and value. Labels describe each value to the user, It allowing differentiation such as home and work for properties and you can create your own custom label using Contact Framework. Create contact using CNMutableContact import Contacts // Contact name prefix contact.namePrefix = "Mr." // Contact first name contact.givenName
Many of us have already heard about PaperTrail gem and its use for versioning of model. I found it very useful for purpose of debugging. Lets have a quick look at exactly what is PapertTrail gem and how we can use it for purpose of debugging. PaperTrail and Versions: When we add papertrail gem in our rails app and run migration for same at that time it creates Version table for us in our DB. When we use it in particular model and perform any kind create, update operation on it then each time it creates associated versions record for
In software development you are destined to deal with lots of code that is not written by you. What would be more stressful than debugging the code that you barely understand. You might have been in the situation where you have been assigned a bug and you have to traverse through lots of file which you have no idea of, just get to root cause of the issue. Being in these situations many times, I have learned few tips and tricks for debugging and would like to share it here. **Checking where the method causing a problem exists.** In some