Skip to content

Instantly share code, notes, and snippets.

View Dynesshely's full-sized avatar
🚀
Fly me to the moon

醉月酿星河 Dynesshely

🚀
Fly me to the moon
View GitHub Profile
@darinkes
darinkes / GuiStateTemplate.cs
Created April 10, 2019 07:56
Avalonia Enum UserControl Content Selection
class GuiStateTemplate : DataTemplate, IDataTemplate
{
[TypeConverter(typeof(EnumConverter))]
public GuiState State { get; set; }
bool IDataTemplate.Match(object data)
{
var enumVal = (GuiState)Enum.Parse(typeof(GuiState), data.ToString());
var result = State == enumVal;
Logging.Debug(string.Format("GuiStateTemplate Match: {0} == {1} ({2})", State, enumVal, result));
@dstockhammer
dstockhammer / unlist-packages.ps1
Last active October 26, 2024 20:35
Unlist all versions of a NuGet package
$PackageId = "xxx"
$ApiKey = "yyy"
$json = Invoke-WebRequest -Uri "https://api.nuget.org/v3-flatcontainer/$PackageId/index.json" | ConvertFrom-Json
foreach($version in $json.versions)
{
Write-Host "Unlisting $PackageId, Ver $version"
Invoke-Expression ".\nuget.exe delete $PackageId $version $ApiKey -source https://api.nuget.org/v3/index.json -NonInteractive"
}
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule