Punit Jain
Hey this is Punit Jain.I brought up in Indore, currently in Mumbai having 4.5 years of software development experience.When not messing with the code I would like to enjoy the m...
Kiprosh is now part of LawLytics
Developing Slack Bot in Elixir Phoenix.
Recently, we have to build an Admin dashboard for an e-commerce application. This involves adding stores, items their photos and other data typically needed for managing the data from admin side for non technical people. Since, we are using rails framework so we had two options that are best suitable as per our need administrate and active admin. The former is very popular recently as it has several advantages over the latter. Unlike active admin you don't have to understand the DSL. It's very flexible and easily customisable. But administrate is still in pre-1.0 version and not very stable
We had requirement of building realtime notification system. So whenever a user mentions n number of users we have to broadcast a message to all the users in real time and thereby update the count of each notification and push the message on their respective client. To implement this we need to understand Channels in phoenix. Channels: Phoenix framework has a built-in facility to manage two way communication between web clients and the server. Sender broadcast a message about topics and receiver subscribes the topics so they can get those messages. Also sender can become receiver and receiver can become
Note: This article requires basic knowledge of elixir. If you are not familiar with I will encourage you to check the link Ecto is a database abstraction layer for elixir. It provides a domain specific language to interacting with your database. It is also intended for relational database much like Active record. But it share more traits with LINQ in how it generate queries. Ecto in many ways different from ORMs like Active record. Unlike Active record, which uses model as a direct interface to interact with database, Ecto has separate concern for querying (using Query module) and actually perform
Nginx is a web server software like apache. The purpose of a web server software to serve web page in response to a browser request. Nginx pronounced as engine-x. It is faster than apache web server for concurrent requests because it does not create a thread for request like apache. Here is a detail comparison of the two https://www.nginx.com/blog/nginx-vs-apache-our-view/ . Installing Nginx with passenger on ubuntu 1.Install rvm and ruby First update the packages in the system sudo apt-get update Then install the rvm and ruby if not installed using this commands curl -L get.
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