Skip to content

Instantly share code, notes, and snippets.

Working from home

Rahul P Nath rahulpnath

Working from home
Block or report user

Report or block rahulpnath

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View INotifyPropertyChanged.markdown
View INotifyCollectionChanged.markdown
View IValueConverter.markdown
rahulpnath / EFMIgrationHistoryDecode
Created Jun 21, 2018
EF Decode Migration History
View EFMIgrationHistoryDecode
void Main()
//SELECT @binaryContent = Model FROM[__MigrationHistory] where MigrationId = ''
//SELECT CAST('' AS XML).value('xs:base64Binary(sql:variable(''@binaryContent''))', 'varchar(max)') AS base64Content
var modelBase64 = "<base64Content>";
var bytes = Convert.FromBase64String(modelBase64);
var uncompressed = Decompress(bytes);
var edmx = Encoding.UTF8.GetString(uncompressed);
rahulpnath / Remove Nuget Restore.ps1
Last active Oct 18, 2018
This powershell script helps remove all NuGet configurations and files that got added while enabling NuGet Restore. More details @
View Remove Nuget Restore.ps1
# This powershell script helps remove all NuGet configurations and files that got added while enabling NuGet Restore.
# More details @
$importNugetTargetsTag= [regex]::escape(@'
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
$restorePackagesTag = '<RestorePackages>.*?</RestorePackages>'
$nuGetPackageImportStamp = '<NuGetPackageImportStamp>.*?</NuGetPackageImportStamp>'
rahulpnath / SqlRenameTableScript.fsx
Last active Nov 29, 2019
GIven an old tableName and newTableName and database details, the script generates a SQL script file to drop create all Index, Constraints. This script is useful if you use convention based naming for tables and the associated Index and Keys and want them all renamed.
View SqlRenameTableScript.fsx
#I @"C:\Program Files\Microsoft SQL Server\140\SDK\Assemblies\";;
#I @"C:\Program Files (x86)\Microsoft SQL Server\140\SDK\Assemblies";;
#r "Microsoft.SqlServer.Smo.dll";;
#r "Microsoft.SqlServer.ConnectionInfo.dll";;
#r "Microsoft.SqlServer.Management.Sdk.Sfc.dll";;
open System.IO
open Microsoft.SqlServer.Management.Smo
View powershell_alias.ps1
function Get-GitStatus { & git status -sb $args }
New-Alias -Name s -Value Get-GitStatus -Force -Option AllScope
function Get-GitCommit { & git commit -ev $args }
New-Alias -Name c -Value Get-GitCommit -Force -Option AllScope
function Get-GitAdd { & git add --all $args }
New-Alias -Name ga -Value Get-GitAdd -Force -Option AllScope
function Get-GitTree { & git log --graph --oneline --decorate $args }
rahulpnath / dynamicPowershellAlias.ps1
Last active Dec 6, 2019
Create dynamic alias for Powershell
View dynamicPowershellAlias.ps1
$aliasFilePath = "<Alias file path>"
function New-CommandAlias {
$functionFormat = "function $commandName { & $command $args }
rahulpnath / TypeScriptSumTypes.jsx
Created Feb 23, 2020
Using Sum Types to Model Data
View TypeScriptSumTypes.jsx
import * as React from "react";
import { render } from "react-dom";
const styles = {
margin: "10px"
export type PaymentOption = FullPaymentOption | PartPaymentOption;
export interface FullPaymentOption {
type: "full";
rahulpnath /
Last active Jun 3, 2020
Cypress Azure AD Login
You can’t perform that action at this time.