Skip to content

Instantly share code, notes, and snippets.

View derekcorreia's full-sized avatar

Derek Correia derekcorreia

View GitHub Profile
@derekcorreia
derekcorreia / pairing_solver.py
Last active August 11, 2025 22:41
NPC Pairing Solver
#!/usr/bin/env python3
"""
CP-SAT solver (relaxed):
- 4 rounds
- groups of 4 players (inferred from N players)
- each player occupies each position (seat 1..4) exactly once across rounds
- no same-team players in same group
- each player must meet players from at least 7 of the other teams (of the other T-1 teams)
- allow up to one repeated pairing per player (i.e., a player may have at most one other player they meet >=2 times),
and any pair is capped at meeting at most 2 times
@derekcorreia
derekcorreia / SCSPFix.ps1
Last active January 23, 2020 15:38
Fixes Sitecore Support Package generator config sets when generated with multiple servers. Replace $source with a "Configs" directory containing ".link" files after un-archiving the SSP. Run from Powershell console.
# Change source to match path of folder from support package with .link files that won't build in config builder
# Source folder should have a web.config or web.config.link, and the app_config folder below it.
$source = "C:\SupportPackage\INSTANCE-Sitecore-prd-cd\Configs"
Write-Host "Fix Sitecore Support Package Links"
Write-Host "Source Directory defined in .ps1: " -NoNewline
Write-Host $source -ForegroundColor Yellow
Write-Host "Confirm path and press any key to begin. Press Ctrl-C to exit"
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore role:require="Standalone or ContentDelivery or ContentManagement">
<sc.variable name="identityServerAuthority" value="https://dco-xpslim-si.azurewebsites.net" />
<settings>
<!-- The URI of the IdentityServer provider. -->
<setting name="FederatedAuthentication.IdentityServer.Authority" value="$(identityServerAuthority)" />
<!-- The client identifier on the IdentityServer. -->
@derekcorreia
derekcorreia / ce-rtl.css
Created January 3, 2018 21:19
Userstyle script for Sitecore 8.2 to display text fields RTL
/* Content Editor styles */
.scContentControl {
direction: rtl;
}
div#ContentWrapper {
direction: rtl;
}
.scContentControlMemo {
direction: rtl;
}