Yoramk Digital Life

Yoram Kornatzky

Software Architect & Engineer Open Source, Mobile, Web, Cloud, Server

Writing a Singleton in Node

Singleton Module Singleton are often needed, here is a quick way to write a singleton in Node.js: singleton.js module.exports = { x: 1, g: (v) => v*v } Use the Singleton one.js var singleton = require('./singleton'); module.exports = { f: () => { singleton.x = singleto...

A Blueprint for Location Tracking Using Laravel and Ionic

Location-Based Service Say you want to construct a mobile app for a location-based service such as on demand cleaning or any field service organization, in general. For a such a location-based service, consumers post a request and suppliers are allocated per demand. Suppliers move around through ...

Location Tracking Apps - Supply Side vs Demand Side

Many location-based mobile apps track user location for providing services. As a developer embarking on such a project, I found it useful to use the supply side vs demand side classification. The user population usually consists of suppliers and consumers. For example, taxi drivers and passengers...

Prototype Java Stream Processing in Node.js

We want to prototype in Node.js a stream processing program that will eventually be coded in Java 8+. A good way to do it is to code in Node.js using arrow functions. Node.js Collections Processing with Lodash Lodash is a Node.js (and JavaScript) module for convenient processing of collections, ...

Working with Linux Through an Enterprise Windows Desktop

The Enterprise Environment This is the common setup. You get a Windows laptop, and you are coding, but your target is a collection of Linux servers. Now, these are Linux servers, be it Ubuntu or CentOS, and they do not have a GUI. Coding directly on these Linux servers forces you to use the old V...

Sharing Data Between Laravel PHP and a Socket.io Server

In a recent project with my colleague Grzegorz Bukat, the server side was dual: A Laravel PHP web application running on Nginx A Socket.io server These two servers were directed at a single jQuery front end. The Laravel server generated the views and handled Ajax calls. The Socket.io server...

Node.js Frameworks for a Socket.io Server

In several projects, we constructed a Socket.io server using plain Node.js with: socket.on('eventName', function(data) {}) With everything nested under: on('connection', function(socket){}) The following example attaches socket.io to a plain Node.JS http server listening on port 3000. var serve...

Real-Time Auctions with Laravel

Real Time Auctions In a real time auction an item is auctioned to the audience with a start price. The audience posts bids topping the price each time, till no more bids are received. At which the the item is considered to be sold to the last bidder (with the highest price). Flow of Real-Time Auc...

A Production Real-Time Auctions System

The Antique House Together with my colleague, Grzegorz Bukat from Warsaw, Poland, I was asked to build a real-time auction system for the Antique House of Michal Niemczyk. The Real-Time Auction The auction is carried by an auctioneer in a physical brick and mortar hall. An auction includes many i...

My Strategy for Keeping with The State of the Art

Influx of New Things Newsletters flow in continuously, you encounter new things while working, you hear of interesting developments, and new domains appear that touch on your interests. How do you stay in sync with the state of the art? These are not things you need to know on the spot, so you ca...