Skip to content

Instantly share code, notes, and snippets.

@XerShade
XerShade / sync-media-dates.php
Created November 26, 2023 09:03
WordPress: Sync Media Dates Plugin
<?php
/*
Plugin Name: Sync Media Dates
Description: Adds a button under the Media Library tab to sync the post date and post date GMT of media files to be the date the file was last modified.
Version: 1.0
Author: XerShade
*/
function sync_media_dates_page() {
add_media_page(
@XerShade
XerShade / project-template.csproj
Created August 20, 2023 17:59
The .csproj file template that I use for most of my C# projects.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)bin\$(AssemblyName)</BaseOutputPath>
@XerShade
XerShade / JsonSerializerTestPerson.json
Created October 4, 2022 21:26
A test person json data file used for unit testing.
{
"$id": "1",
"$type": "XerShade.UnitTesting.Models.Person, XerShade.UnitTesting",
"FirstName": "John",
"LastName": "Doe",
"Age": 33
}