Skip to main content

Posts

Showing posts from January, 2020

Mongo DB Conditional Serialization

Mongo DB - Conditional Serialization Sometimes, the documents retrieved from the database should be serialized differently for different conditions. We can make use of the below technique to do that, public class Company {     public ObjectId Id { get; set; }     [BsonDateTimeOptions(DateOnly = true)]     public DateTime JoiningDate { get; set; }     public bool ShouldSerializeJoiningDate() {         return JoiningDate > new DateTime(1900, 1, 1);     } } For more information on conditional serialization, refer the Mongo DB documentation below https://mongodb.github.io/mongo-csharp-driver/1.11/serialization/

Git Shortcuts and Bash Aliases

Git Shortcuts that come in handy during development to make things easier.  Edit  /.gitconfig and add a section like below: [alias]     co=checkout     cob=checkout -b     br=branch     brd=branch -d     brD=branch -D     st=status     cm=commit -m     unstage=reset --soft HEAD^     ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cvlue\\ [%cn]" --decorate     ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cvlue\\ [%cn]" --decorate -- numstat     la="!git config -l | grep alias | cut -c 7-" Adding Bash aliases -  Edit /.bashrc as below, echo ".bashrc running..." alias al='source C:\\Users\\{{username}}\\.bashrc' alias cdgit = 'cd C:\\Git' {{similarly you can all shortcutes to your workspaces for easy navigation}} alias gcd='git checkout develop ; git status' alias gs='git status' alias g='git' alias gp='git pull' alias h='history' alias ll='ls -la' echo "don

Angular vs React

Angular vs React Angular and React are the most used modern JavaScript frameworks out there currently. Here's a look at their features and comparing the differences                                          1. Performance Angular - Competitive, optimized with change detection Angular performs worse, especially in the case of complex and dynamic web pages. The performance of Angular apps is negatively affected by the bidirectional data-binding. Each binding is assigned a watcher to track changes and each loop continues until all the watchers and associated values are checked. Because of this, the more bindings you have, the more watchers are created, and the more cumbersome the process becomes. However, the most recent update of Angular has greatly improved its performance, and it does not lose to React anymore. Moreover, the size of an Angular application is slightly smaller than the size of a React app. React     - Competitive, optimized with Virtual DOM. React's performance i

Angular Features

Features of Angular Angular is a powerful modern Javascript framework and it comes with a lot of inbuilt features to develop secure web and mobile applications. Let's look at the features of angular that makes it stand out. Cross-platform  - Web, Native and Desktop Applications Productivity  - IDE's, Templates, Angular CLI Forms  - Template-driven and Reactive forms for building UI pages Inbuilt Angular Router Module  - HttpClientModule Inbuilt Dependency Injection RxJS support for asynchronous calls (Observables) Tree shaking : Build Optimization step which tries to ensure any unused code does not get used on the final bundle. Smaller bundles and faster startup time. @Injectable { providedIn: } Differential Loading  - Map files for Old and Modern browsers Ivy  - New Rendering Engine ngRx  for State Management Internalization and Localization  using i18n inbuilt tool or Ngx-translate third-party tool. (Internalization - Process of designing and preparing your app to be usable