Skip to content

Instantly share code, notes, and snippets.

View Somfic's full-sized avatar
yeehaw

Lucas Somfic

yeehaw
View GitHub Profile
@rakion99
rakion99 / Offlinenametouuid.cs
Last active April 25, 2024 14:12
Generate an offline minecraft UUID v3 based on the case sensitive player name, based on https://gist.github.com/games647/2b6a00a8fc21fd3b88375f03c9e2e603
private string GetOfflinePlayerUUID(string username)
{
//new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name));
byte[] rawresult = System.Security.Cryptography.MD5.Create().ComputeHash(Encoding.UTF8.GetBytes($"OfflinePlayer:{username}"));
//set the version to 3 -> Name based md5 hash
rawresult[6] = (byte)(rawresult[6] & 0x0f | 0x30);
//IETF variant
rawresult[8] = (byte)(rawresult[8] & 0x3f | 0x80);
//convert to string and remove any - if any
string finalresult = BitConverter.ToString(rawresult).Replace("-", "");
@shuki25
shuki25 / edversion.py
Last active May 16, 2021 15:01
Elite Dangerous Semantic Versioning
from semantic_version import Version
class EDVersion(Version):
def __init__(self, version_string=None, **kwargs):
self.version_xref = {
"April Update EDH": "3.4.0",
"April Update Patch 1 EDH": "3.4.1",
"April Update Patch 2 EDH": "3.4.2",
"January Update": "3.6.0",
"January Update - Patch 1": "3.6.1",
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d