Two mistakes with Redux code

Last week, I made two mistakes with my Redux code. Mistake #1: deepClone Redux state The state within the reducer is immutable. That is, the old state should never be changed. To ensure that the old state never gets changed, I got a “cool idea”. Do a deepClone of the entire state. So, my reducer code looked like:

The[…]

Read more

Minimal scaffolding for React with Webpack

The article explains how to do a minimal scaffolding of React application using Webpack. Setup Git. Setup npm. Install packages. Setup babel. Setup Webpack. Define entry. Include bundle. Run application. Setup Git Setup a git repo as follows.

Setting up a git repo is optional if you are only doing a demo. The next step which creates a project[…]

Read more

Customise Bootstrap in Meteor with Less

Meteor is a JavaScript framework built on top of NodeJS to create web applications and mobile apps based on Cordova. Bootstrap is a popular stylesheet theme maintained by core developers from Twitter. This article explains how to customise Bootstrap within a Meteor application. Bootstrap styles are written in Less. Less is similar to SASS. It allows to reuse variables and[…]

Read more

Available for projects in React

Over the last six months, I am working intensely with the React ecosystem. I developed a web application and two native apps from the scratch. I have also been working on a few existing applications for start-ups based in New York, Spain, and Sweden. The move away from .NET has been amazing. I have never learnt something this fast. And I[…]

Read more

Quick guide to learn Entity Framework

The article provides a quick guide to understanding Entity Framework. Why Entity Framework? Entity Framework is an ORM layer which implements the Unit of Work pattern. For ASP.NET, the request processing can be considered as a business transaction. Entity framework keeps a track of all changes made to database entities and allows the changes to be saved in a single transaction.[…]

Read more

oAuth Server and Role based security in Web API

ASP.NET Web API has implemented an oAuth2 server. Web API has an end-point /token. Using the end-point with login credentials will give an access token. The access token is used to identify the user at the server. Role based security is not related to oAuth2. Role based security restricts access to various parts of the API based on the user’s[…]

Read more

FancyBox integration with ASP.NET MVC application

FancyBox is a jQuery plugin which is used to open text, photos, etc as a modal dialog. The post explains how to integrate FancyBox with an ASP.NET MVC application. Bundling FancyBox is available as a Nuget package. The Nuget package has a stylesheet which it puts in the Content folder, associated images and sprites which it puts in the Content/FancyBox[…]

Read more

Entities and Models in large ASP.NET MVC application

ASP.NET MVC is a presentation framework. To build a large application, a few more architectural components are required. In the post, a greeting is retrieved from the database and displayed in the UX. Data Access Layer Data access layer is distributed into three assemblies: HelloWorldApp.Entities HelloWorldApp.Repositories HelloWorldApp.Repositories.Contracts Greeting class

IGreetingRepository interface

GreetingRepository class

Business Logic Layer The business[…]

Read more

ASP.NET Identity Framework 2.0 with MySQL database

ASP.NET Identity Framework 2.0 is integrated with EntityFramework and provides entity classes to deal with Users, Roles, Claims, and third-party Logins. The Identity database can be any store – SQL Server, MySQL or Oracle. This article will provide guidance on how to integrate ASP.NET Identity 2.0 with a MySQL database. SQL scripts for MySQL MySQL has naming conventions which are[…]

Read more

Random Select using Fisher Yates algorithm

Today, I had a chance to use Fisher Yates algorithm. Here is the problem statement: Out of an array of N items, randomly pick K items where 0 < K < N. My first version of the algorithm was as follows:

The code above has two problems: When n == k, the loop takes a long time to complete.[…]

Read more
1 2 3 8