Skip to content

Instantly share code, notes, and snippets.

Avatar

ABHAY DHAR abhaydhar

  • bengaluru
View GitHub Profile
View Ajax bind ajax:complete event
$("#myform").bind('ajax:complete', function() {
//Do Something
});
@abhaydhar
abhaydhar / DeployKudu
Created Oct 7, 2019
Powershell Script to deploy Dotnet and Unicorn Files to Azure App Service using Kudu Rest API
View DeployKudu
# User name from WebDeploy Publish Profile.
$userName = "`$" #Use backtick while assigning variable content
# Password from WebDeploy Publish Profile
$password = "password"
# Encode username and password to base64 string
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $userName, $password)))
$envName = "https://.scm.azurewebsites.net" #Replace from publish settings
@abhaydhar
abhaydhar / FileRenameExtensionMethod
Created Mar 5, 2018
Extension Method to Rename a file in a directory
View FileRenameExtensionMethod
public static class ExtensionMethod
{
public static void Rename(this FileInfo fileInfo, string newName)
{
fileInfo.MoveTo(fileInfo.Directory.FullName + "\\" + newName + fileInfo.Extension);
}
}
//Caller
FileInfo file = new FileInfo("Complete_Directory_path_of_file");
file.Rename(fName.Replace('/', '-'));
You can’t perform that action at this time.