Jun 24, 2018

Javascript: Not allow user to open website in multiple windows

jQuery plugin to check if current window is duplicate window,
I createdd this plugin based on timkellypa's answer on stackoverflow
"Stop people having my website loaded on multiple tabs"

This plugin works across all browsers IE, Firefox, Microsoft Edge & Google chrome

It is basically checking GUID of the window against value in cookie

Sample usage:

    Multi window

    This is test page,
Click here to open another window

Jan 10, 2018

Vpnbook Dialer application for Windows 10

Created Vpnbook dialer windows application which auto retrieves vpnbook.com password and connects PPTP vpn connection using the retrieved password.

vpnbook.com dialer v1.0
Released the application on github.com

Please note before using the application a PPTP VPN connection needs to be set-up using Windows wizard in control panel.

Source Code: https://github.com/nitinjs/Vpnbook-Dialer

C# - Programatically download file from Dropbox

To download file from dropbox use following code:

We are just appending the "dl=1" querystring parameter to the shared dropbox user shared url and directly accessing the file as HTTPS stream

Dec 8, 2017

C# generic function to export list of objects into excel file

C# generic function to export list of objects into excel file using EPPLUS library, if the file already contains the tab then data will be appended to the excel tab in worksheet.

Nov 8, 2017

Visual Studio 2017 Installer stuck at Applying Microsoft VisualStudio Debugger JustInTime

While installing Visual Studio 2017 Installer may stuck at Applying Microsoft VisualStudio Debugger JustInTime

if you are using older version of the installer. To solve the issue:
Solution 1
1. Click On Cancel, after few minutes it will ask to update VS installer.
2. Update the Visual Studio Installer. 
3. Restart your PC. Installer will auto-continue.

Solution 2
1. Download Process Explorer
2. Kill the process PowerShell.exe under vs_installershell.exe
3. Installer will resume skipping JustInTime
4. After VS installation completes you have to manually install JustInTime  


Package ‘Microsoft.VisualStudio.Debugger.JustInTime,version=15.0.26621.2’ failed to install


The solution was as simple as updating the System Variable __PSLockDownPolicy value to 1:
This is related to the PowerShell Constrained Language Mode, see the following article for more details:

Nov 9, 2016

Handling dynamically created RadioButtons in ASP.NET MVC




    @model ExampleViewModel
    @using (Html.BeginForm())
        <table class="table table-bordered table-striped">
            @for(int i=0;i<Model.Questions.Count;i++)
                var question = Model.Questions[i];

Aug 5, 2016

Marathi Keyboard v4.0 released on github

Virtual Keyboard Software to type in Devnagri script
Wrote C# code to map each key on keyboard with devanagari unicode font.

Source available on github:  https://github.com/nitinjs/marathi-keyboard

  1. Type in marathi in any windows application easily using virtual keyboard software
  2. To switch between Marathi & Hindi language typing mode press "Ctrl+M"