Skip to content

Instantly share code, notes, and snippets.

View shashank-shekhar's full-sized avatar
👋

Shashank Shekhar shashank-shekhar

👋
View GitHub Profile
@shashank-shekhar
shashank-shekhar / main.bicep
Created June 22, 2024 02:29
Bicep file to create azure resources
param location string = resourceGroup().location
param applicationSuffix string
param environment string
param resourceAbbreviations object
param sqlServerConfig object
param appServicePlanConfig object
param sqlDbConfig object
// Function to create resource names
@description('Creates a resource name based on the application suffix, environment, and resource abbreviation.')
@shashank-shekhar
shashank-shekhar / postman_extract_access_token.js
Created May 30, 2024 01:32
Postman script to exract access_token from response and save it into a variable
var response = JSON.parse(pm.response.text());
var jwt = response.access_token;
pm.collectionVariables.set("access_token", jwt);
var cryptoJS = require('crypto-js')
function base64UrlDecode(base64Url) {
let base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
switch (base64.length % 4) {
@shashank-shekhar
shashank-shekhar / link.md
Last active April 23, 2024 18:07
Update github token on windows
@shashank-shekhar
shashank-shekhar / move.bat
Created March 20, 2024 17:14
copy one repo into an existing repo with history
cd repo2
git checkout master
git remote add r1remote **url-of-repo1**
git fetch r1remote
git merge r1remote/master --allow-unrelated-histories
git remote rm r1remote
#https://stackoverflow.com/a/17373088
@shashank-shekhar
shashank-shekhar / real-clean.ps1
Created February 27, 2024 17:36
Visual Studio real clean
$targetFolders = @('bin', 'obj', 'packages')
$startPath = "."
# Recursively get all directories that match the target folder names, case-sensitively.
Get-ChildItem -Path $startPath -Directory -Recurse | Where-Object {
$dirName = $_.Name
$targetFolders.Contains($dirName)
} | ForEach-Object {
Write-Host "Deleting $($_.FullName)"
@shashank-shekhar
shashank-shekhar / donet-hide-warnings.cmd
Last active February 12, 2024 19:44
dotnet build hide warnings in output log
dotnet build .\ASM.sln --restore --nologo -v q --property WarningLevel=0 /clp:ErrorsOnly
@shashank-shekhar
shashank-shekhar / remove dotted folders
Created December 5, 2023 20:52
Delete folders with three dots ... in the name
rd \\?\"C:\path\to\folder\..." /s
@shashank-shekhar
shashank-shekhar / real-clean.bat
Created November 6, 2023 22:52
Clean VS project for real
for /d /r . %%d in (bin,obj) do @if exist "%%d" rd /s/q "%%d"
ghp_RiWwNlzPq1jpgpxPtNr2Fmmd1Ng3mH1kgHVe
https://octopus.com/blog/automate-developer-machine-setup-with-chocolatey