Skip to content

Instantly share code, notes, and snippets.

View jermdavis's full-sized avatar
🐱

Jeremy Davis jermdavis

🐱
View GitHub Profile
@jermdavis
jermdavis / ExpiringLinkConfigurator.cs
Last active April 22, 2024 07:14
Example code for expiring outdated links in Statiq. Example code for a blog post: https://blog.jermdavis.dev/posts/2024/expiring-outdated-blog-links - More info there.
using Statiq.App;
using Statiq.Common;
using StatiqGenerator.Customisations.ReadingTime;
namespace StatiqGenerator.Customisations.DisappearingLinks
{
public class ExpiringLinkConfigurator : IConfigurator<Bootstrapper>
{
public void Configure(Bootstrapper configurable)
@jermdavis
jermdavis / BlueSky-Posting-Example.cs
Last active June 2, 2025 08:24
Some hacky code that shows how to post an image attachment to a BlueSky post via the API
using System.Net.Http;
using System.Threading.Tasks;
using System.Net.Http.Json;
using System.Text.Json.Nodes;
using System.Net.Http.Headers;
using System.Text.Json;
using System.Text.Json.Serialization;
internal class Program
{
@jermdavis
jermdavis / fixup-10.2-for-win11.ps1
Last active June 16, 2025 07:38
A script to help fix the Sitecore v10.2 SIF scripts for installs on Windows 11. Explanation in the blog post at https://blog.jermdavis.dev/posts/2025/fix-install-sitecore-102-win11
function FixupXConnect
{
$source = "xconnect-xp0.json"
$json = Get-Content $source -Raw | ConvertFrom-Json
$json.Tasks.AddSqlDatabasesToElasticPool.Params | Add-Member -MemberType NoteProperty -Name "TrustServerCertificate" -Value ($true)
$json.Tasks.CreateShardApplicationDatabaseServerLoginInvokeSqlCmd.Params | Add-Member -MemberType NoteProperty -Name "TrustServerCertificate" -Value ($true)
$json.Tasks.CreateShardManagerApplicationDatabaseUserInvokeSqlCmd.Params | Add-Member -MemberType NoteProperty -Name "TrustServerCertificate" -Value ($true)