Skip to content

Instantly share code, notes, and snippets.

View UweKeim's full-sized avatar
😊
www.uwe.co

Uwe Keim UweKeim

😊
www.uwe.co
View GitHub Profile
@leodutra
leodutra / windows-10-git.md
Last active September 25, 2024 17:28
Enable long paths on Windows 10 and Git

If you run Windows 10 Home Edition you could change you Registry to enable Long Paths.

Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem in regedit and then set LongPathsEnabled to 1.

If you have Windows 10 Pro or Enterprise you could also use Local Group Policies.

Go to Computer Configuration > Administrative Templates > System > Filesystem in gpedit.msc, open Enable Win32 long paths and set it to Enabled.

git config --system core.longpaths true
@UweKeim
UweKeim / DayOfCentury.cs
Last active November 14, 2017 06:53
Calculate DayOfCentury for C# DateTime, similar to DayOfYear
/// <description>
/// Calculates the total number of days passed sind first of January 2000
/// until a given Date.
/// </description>
public static long DayOfCentury(DateTime dt)
{
var span = dt.Date - new DateTime(2000, 1, 1);
return (long)span.TotalDays;
}