Skip to content

Instantly share code, notes, and snippets.

@odan
odan / soap-xmldsig.md
Created June 1, 2021 14:23
Sign SOAP messages with xmlseclibs

Sign SOAP messages with xmlseclibs

Requirements

  • 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.

Removing a Commit From Github

If you accidentally committed something you shouldn’t have, and pushed it to Github, there are still ways to delete or modify it.

You can do an interactive rebase, which is useful if the commit isn’t the most recent one. If the commit was, for example, 12 commits ago, you can rebase from then, remove the offending commit, and save.

git rebase -i HEAD~12

NES RAM map

CPU Memory

NES Mega Man 5

  • $00B0: M. Buster - 00 to 9C (max)
  • $00BD: Number of E energy tanks - 80 to 89
  • $00BE: Number of M - 80 to 89
  • $00BF: Number of lives - 00 to 09

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
@odan
odan / Program.md
Last active January 10, 2023 15:07
MySqlMigrationSqlGenerator Example

MySqlMigrationSqlGenerator Example

dotnet add package MySql.Data.EntityFramework
using System.Configuration;
using System.Data;
using System.Data.Common;
@odan
odan / unbloat.bat
Last active December 3, 2023 21:17
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"

PHP FFI - Using a C++ DLL with C bindings with MinGW-64

Requirements

  • MinGW-64

Setup

On Windows:

File Operations in C++

Reading a file into a string variable

#include <iostream>
#include <fstream>
using namespace std;

fstream file("file.name.xml", fstream::in);