Skip to content

Instantly share code, notes, and snippets.

View emptyother's full-sized avatar

Tom A. Vibeto emptyother

View GitHub Profile
@emptyother
emptyother / .mocharc.json
Last active January 6, 2020 10:16
JSON Schemas
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://onlyhuman.dk/json-schema/.mocharc.json",
"type": "object",
"title": "The Root Schema",
"properties": {
"diff": {
"$id": "#/properties/diff",
"type": "boolean",
@emptyother
emptyother / uuid_from_bin.sql
Created August 21, 2020 09:21 — forked from tzal/uuid_from_bin.sql
MySQL: convert BINARY(16) to GUID (UUID)
# MySQL: convert BINARY(16) to GUID (Microsoft-style UUID)
# 0x11223344556677889900AABBCCDDEEFF → '44332211-6655-8877-9900-AABBCCDDEEFF'
# usage: CREATE TABLE example(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, guid BINARY(16) NOT NULL UNIQUE);
# SELECT id, uuid_from_bin(guid) FROM example;
CREATE FUNCTION uuid_from_bin(b BINARY(16))
RETURNS char(36) CHARSET utf8
DETERMINISTIC
BEGIN
DECLARE h CHAR(32);
@emptyother
emptyother / uuid_to_bin.sql
Created August 21, 2020 09:23 — forked from tzal/uuid_to_bin.sql
MySQL: convert GUID (UUID) to BINARY(16)
# MySQL: convert GUID (Microsoft-style UUID) to BINARY(16)
# '11223344-5566-7788-9900-AABBCCDDEEFF' → 0x44332211665588779900AABBCCDDEEFF
# usage: CREATE TABLE example(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, guid BINARY(16) NOT NULL UNIQUE);
# INSERT INTO example(guid) VALUES (uuid_to_bin(UUID()));
CREATE FUNCTION uuid_to_bin(s CHAR(36))
RETURNS binary(16)
DETERMINISTIC
RETURN UNHEX(CONCAT(
SUBSTRING(s,7,2),SUBSTRING(s,5,2),SUBSTRING(s,3,2),SUBSTRING(s,1,2),
@emptyother
emptyother / DateTimeSystem.ini
Created January 2, 2025 10:11
Date, Time, and System desktop widget
[Metadata]
Name=Date, Time, and System
Author=emptyother
Information=https://github.com/emptyother/Rainmeter-Skin
Version=2.0.0
License=ISC
[Rainmeter]
Update=1000
DynamicWindowSize=1