General

Meta Programming in Ruby

These below are the available scopes where you can evaluate your code: 1. Instance Scope : (instance_eval, instance_exec) 2. Class Scope / Module Scope: (class_eval, class_exec, module_eval, module_exec) Scopes in simple term is the area of visibility and accessibility. Out of that area, things are not valid and does not Read more…

General

Whats new in Rails 5.2

Rails 5.2 is released with RC1 Status which is considerably stable. To install rails 5.2 you will have to do gem install rails — prerelease. Rails 5.2 is the major update in rails before the release of Rails 6. In this 5.2 release, most talked about feature is Active Storage. Active Storage is Read more…

General

RVM installation and configuration

RVM(Ruby Version Manager) is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems To install RVM As a first step install mpapis public key used to verify installation package to ensure security. gpg –keyserver hkp://keys.gnupg.net –recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 Read more…

General

The Ultimate Guide to Blocks

What is it? How does it work? Ruby code blocks are definitely one of the coolest features of Ruby. Blocks are just chunk of code. In other programming languages, they may refer to it as closures.   Blocks Ruby blocks are little anonymous functions that can be passed into methods. Read more…

General

Console in Node.js

Introduction If you start the Node.js binary without any arguments, you will see the REPL command prompt, the > character and from this prompt ( interactive shell ) you can execute raw JavaScript code you wish. Those who are familiar with browser-side development has probably used console.log for writing information to the Read more…

General

Event Emitter in Node.js

Event Emitter in Node.js Stability: 2 – Stable Much of the Node.js core API is built around an idiomatic asynchronous event-driven architecture in which certain kinds of objects (called “emitters”) emit named events that cause Function objects (“listeners”) to be called. For instance: a net.Server object emits an event each time a peer connects to Read more…

General

Middleware in Node.js

Middleware We have used existing middleware (body-parser, cookie-parser, static, and connect-session, to name a few), and we’ve even written some of our own (when we check for the presence of &test=1 in the querystring, and our 404 handler). But what is middleware, exactly? Conceptually, middleware is a way to encapsulate Read more…

General

Node JS Architecture

Node JS Architecture Before starting some Node JS programming examples, it’s important to have an idea about Node JS architecture. We will discuss about “How Node JS works under-the-hood, what type of processing model it is following, How Node JS handles concurrent request with Single-Threaded model” etc. in this post. Read more…

General

Timers in Node.js

Timers in Node.js All of the timer functions are globals. You do not need to require() this module in order to use them. clearImmediate(immediateObject)# Added in: v0.9.1 Stops an immediateObject, as created by setImmediate, from triggering. clearInterval(intervalObject)# Added in: v0.0.1 Stops an intervalObject, as created by setInterval, from triggering. clearTimeout(timeoutObject)# Read more…

General

Overview of Blocking vs Non-Blocking

This is about the difference between blocking and non-blocking calls in Node.js. It will refer to the event loop and libuv but no prior knowledge of those topics is required. Readers are assumed to have a basic understanding of the JavaScript language and Node.js callback pattern. “I/O” refers primarily to Read more…