Skip to content

Instantly share code, notes, and snippets.

View sangram-chavan's full-sized avatar
💭
Looking for Opportunity

Sangram Chavan sangram-chavan

💭
Looking for Opportunity
View GitHub Profile
@sangram-chavan
sangram-chavan / AsyncLock.cs
Created December 29, 2023 14:49
Using Locks using attribute in Async Await Scenario
[Serializable]
public class MethodLockedAttribute : MethodInterceptionAspect
{
private int maximum_concurrency_number;
private static ConcurrentDictionary<int,SemaphoreSlim> SemaphoreSlimRepo=new ConcurrentDictionary<int, SemaphoreSlim>();
public MethodLockedAttribute(int maximumConcurrencyNumber)
{
maximum_concurrency_number = maximumConcurrencyNumber;
}
@sangram-chavan
sangram-chavan / GIT References
Last active June 20, 2023 04:42
GIT References
https://ndpsoftware.com/git-cheatsheet.html#loc=local_repo;
https://about.gitlab.com/images/press/git-cheat-sheet.pdf
https://education.github.com/git-cheat-sheet-education.pdf
@sangram-chavan
sangram-chavan / README.md
Created March 18, 2020 14:38 — forked from jamesramsay/README.md
Gmail: delete old emails automatically

Gmail: delete old emails automatically

Automatically deletes old emails that match the specified label.

Get started

  • Create a new Google Apps Script at https://script.google.com
  • Overwrite the placeholder with the javascript below
  • Update the following constants:
  • LABEL_TO_DELETE: the label that should be have old messages deleted
@echo off
FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
IF (%adminTest%)==(Access) goto noAdmin
for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
echo.
echo goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
@sangram-chavan
sangram-chavan / CustomTimeSpanFormatter
Last active August 29, 2015 14:11
Custom TimeSpan Format
/* Custom TimeSpan formar
@"%s",
@"%s\.f",
@"%s\.f",
@"%s\.ff",
@"%s\.fff",
@"%m\:%s",
@"%m\:%s\.f",
@"%m\:%s\.ff",
@sangram-chavan
sangram-chavan / Create-Bootable-ISO-Image-From-OS-X-For-VirtualBox
Last active April 14, 2020 13:29
Create-Bootable-ISO-Image-From-OS-X-For-VirtualBox
Create-Bootable-ISO-Image-From-OS-X-Yosemite-For-Intel-Based-Machines
# Mount the installer image
hdiutil attach Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
# Convert the boot image to a sparse bundle
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Yosemite
# Increase the sparse bundle capacity to accommodate the packages
hdiutil resize -size 8g /tmp/Yosemite.sparseimage