Skip to content

Instantly share code, notes, and snippets.

odan /
Last active May 16, 2024 02:17
Nginx and PHP Setup on Windows

Nginx and PHP Setup on Windows

For local development you could also use Nginx with PHP as an replacement for XAMPP.

Install Nginx

odan / unbloat.bat
Last active May 12, 2024 12:25
Remove Windows Bloatware
@echo off
winget list
winget uninstall "Solitaire & Casual Games"
winget uninstall "Microsoft Kontakte"
winget uninstall "Movies & TV"
winget uninstall "News"
winget uninstall "Get Help"
winget uninstall "Microsoft People"
odan /
Last active May 10, 2024 15:31
Generating UUID v4 in MySQL

Generating UUID v4 in MySQL

      # 1th and 2nd block are made of 6 random bytes
odan /
Last active April 17, 2024 05:36
Installing Xdebug for XAMPP
odan / remove-namespaces-xml.php
Last active March 29, 2024 09:34
Remove all namespaces from XML in PHP (dirty hack)
$dom = new DOMDocument();
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
$dom->loadXML(file_get_contents(__DIR__ . '/demo.xml'));
$dom = removeAllNamespaces($dom);
using System;
using System.Collections.Generic;
using System.Globalization;
// CultureInfo culture = new CultureInfo("en-US");
// Full-date notation as defined by RFC 3339, section 5.6, for example, 2024-03-28
string date1 = string.Format("{0:yyyy}-{0:MM}-{0:dd}", DateTime.Now);
odan /
Created June 1, 2021 14:23
Sign SOAP messages with xmlseclibs

Sign SOAP messages with xmlseclibs


  • PHP 7.4+
  • OpenSSL

Generating Public and Private Keys

First we have to create a private key for signature creation, and a public key for verification.

Creating a ASP.NET Core Web API from scratch

Requires .NET 8 SDK

dotnet new sln -o MyApi
cd MyApi

dotnet new webapi -o MyApi

Convert video to a Twitter-friendly format

Simple, but with minimum modification:

ffmpeg -i "input.mp4" -pix_fmt yuv420p -vcodec libx264 "output.mp4"

Resizes the video and may better support encodings: