Skip to content

Instantly share code, notes, and snippets.

View Axeltherabbit's full-sized avatar
💀
dead

Axel Axeltherabbit

💀
dead
View GitHub Profile
@Axeltherabbit
Axeltherabbit / arbiter.py
Last active April 3, 2023 22:31
2 players game socket example with server as arbiter
#!/usr/bin/python # This is server.py file
import socket # Import socket module
s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
print(host)
port = 8085 # Reserve a port for your service.
print('Server started!')
print('Waiting for clients...')
@Axeltherabbit
Axeltherabbit / SwitchWebConfig.ps1
Last active December 11, 2024 15:34
ps1 script to switch asp.net webconfig profile locally, it's useful if you want to try another profile without publishing
if (-not $($args[0])) {
Write-Host "The profile variable is null or empty."
}
$xml = Resolve-Path "../web.config";
$xdtPath = "../web." + $($args[0]) + ".config"
$xdt = Resolve-Path $xdtPath;
Add-Type -LiteralPath "../Microsoft.Web.XmlTransform.dll"