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 / 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
@shashank-shekhar
shashank-shekhar / neo4j-dump.ps1
Last active October 3, 2023 18:36
Backup and restore of neo4j database dump running in a docker container
# get container id
docker ps
$container = <container_id>
# backup here the database name is neo4j, replace it with the name of your databse
docker exec $container neo4j-admin dump --database=neo4j --to path/to/create/dump-file.dump
# this will stop the database inc case the dump fails.
docker $container neo4j stop
# restore database
neo4j-admin load --from=path/to/your/dump-file.dump --database=graph.db --force