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.
Cordova File Transfer plugin allows you to transfer / upload photos from mobile to server. You generally need a file with path for transferring / uploading files via File Transfer plugin. More information on how to use Cordova File transfer plugin can be found here. This plugin won't help much when we have a Base64 image (usually a drawing or signature drawn on canvas). To upload such images we can do: take your base64. write it to a file. then just use file transfer plugin to upload it to server. In this article, I would explain how we can write Base64 image
Active Admin is a great plugin that helps us to get administration functions with elegant and simple interface up and live quickly without much of a hassle or efforts. One can also make use of various customisations as per their need with very little effort. In this article, I will be explaining how we can add custom search bar in Active Admin. Adding custom search bar is not as easy and straight forward as other Active Admin customisations. I will be making use of jQuery to do this. Here, I will be taking an example of searching resources with tags
A regular expression is a pattern describing a certain amount of text and is a type of shorthand to describe a search pattern. It is used to find text which matches a pattern within a larger text, to replace the matching text or to split the matching text into groups. Regular expressions power of extracting specific text from documents resides in their ability to replace many lines of code with as little as one line. Some terms used in regular expressions: Literal - A literal is a character we use in a search or matching expression. For example, to find
Ruby is too dynamic. We can do almost anything in runtime, from creating the classes at runtime to creating methods dynamically. If you are coming from some other language, it would be shocking for you too know that nothing is private in ruby. You can access private and protected method from anywhere you want. You can call this a flexibility or a curse. But a smart developer knows when to utilize the power of extreme flexibility that Ruby provides and when to stay away from it. Is this all Ruby can do in terms of flexibility? Definitely not. Ruby have
Here are few Ruby on Rails and general developer tips & tricks to improve code readability do things Rails way improve productivity They say "Good code is like a good joke: It needs no explanation". 1) idiomatic code Instead of this code... def delete(notes) notes = notes.where('type = (?)', 'evernote') notes.any? && notes.map(&:destroy) end Better way is... def delete(notes) notes.where('type = (?)', 'evernote').map(&:destroy) end 2) Refactor Instead of this code identifier = resource.social_identifier data = { identifier: identifier } render json: data.to_json Prefer this? render json: { identifier:
React Native has made mobile application development process bliss for developers, there’s no doubt in that. I’ve been working on it full time since last 5 months and I couldn’t be more happier then how I’m right now. After working on bunch of React Native projects, I was retrospecting the libraries I was using and turns out there are quite few of them which are essentially shaping up my projects very well. Hence, I thought I could compile a list and share it with the community. Here we go: React Native App IntroMost of the users
We humans do not live in a controlled environment. We are continuously exposed to so many substances at any given time, including those we encounter at work, school, home, in the food we eat and the air we breathe. It is very unlikely to know what we have been exposed to exactly everyday. There are usually many years (often decades) between exposure to a carcinogen and the development of cancer. Cancer is caused by changes in a cell's DNA – either by genetic factors or caused by environmental exposures such as lifestyle factors (diet and nutrition, level of physical activity, tobacco
We've one Blogging application and whenever User post a new Article we wanted to show that to whom his/her post is delivered, who has opened a post or clicked.. events like that. So that User will know how many people are reading his/her post and also how often. We were already using services of Sendgrid. Now Sendgrid provides different APIs for different purposes. Some of them I'm listing below. SMTP API, WEB API, EVENT WEBHOOK, PARSE API. Now, We needed EVENT WEBHOOK API for what we wanted to achieve. Here is a link to EVENT WEBHOOK API. The
Recently I faced one scenario with NULL value with NOT IN, I have added the details here about what I learnt. suppose we have two table Category and Product Category id | name -------- 1 | Category 1 2 | Category 2 3 | Category 3 4 | Category 4 Product id | name | category_id ----------------------------- 1 | Product 1 | 1 2 | Product 2 | 2 3 | Product 3 | 2 4 | Product 4 | 3 5 | Product 5 | 4 6 | Product 6 | NULL Scenario :- *I just want to retrieve all the Products excluding Category 1 and Category 3 so I wrote following query :- Product.joins(:category)
What is Lazy Enumerator Ruby 2.0 lazy enumerator allows you to iterate over infinite values and take the values you want for your calculation.This code would result in an infinite loop. range = 1..Float::Infinity range.collect { |x| x*x }.first(10) The code results in an infinite loop because the Enumerable#collect is eager.It means that first collect processes all the values from the first array and then save it in the second array.Since we have an infinite range here first method would never get a chance to execute. With ruby 2.0 you can