Skip to content

Instantly share code, notes, and snippets.

View acrylic-style's full-sized avatar
💛

Acrylic Style acrylic-style

💛
View GitHub Profile
@acrylic-style
acrylic-style / merge.js
Last active November 27, 2021 04:01
Merge data1.json and data2.json, and you get result.json
const fs = require('fs/promises')
const util = require('util')
const process = (k1, v1, k2, v2) => {
if (util.isDeepStrictEqual(v1, v2)) return v1
if (typeof v1 === 'undefined' || v1 === null) return v2
if (typeof v2 === 'undefined' || v2 === null) return v1
let data = null
if (Array.isArray(v1) !== Array.isArray(v2)) {
if (Array.isArray(v1)) {
@acrylic-style
acrylic-style / DumpProtocol.java
Created May 25, 2022 12:26
List of packets in 1.19 Pre-release 2
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import net.minecraft.network.ConnectionProtocol;
import net.minecraft.network.protocol.PacketFlow;
import java.util.Comparator;
import java.util.Locale;
import java.util.function.Function;
public class DumpProtocol {
public static void main(String[] args) {
@acrylic-style
acrylic-style / gist:244e09f73d3347825bb04bb8410bceac
Created May 25, 2022 15:05
List of packets in 1.19 Pre-release 3
HANDSHAKING SERVERBOUND 0x00 ClientIntentionPacket
PLAY SERVERBOUND 0x00 ServerboundAcceptTeleportationPacket
PLAY SERVERBOUND 0x01 ServerboundBlockEntityTagQuery
PLAY SERVERBOUND 0x02 ServerboundChangeDifficultyPacket
PLAY SERVERBOUND 0x03 ServerboundChatCommandPacket
PLAY SERVERBOUND 0x04 ServerboundChatPacket
PLAY SERVERBOUND 0x05 ServerboundChatPreviewPacket
PLAY SERVERBOUND 0x06 ServerboundClientCommandPacket
PLAY SERVERBOUND 0x07 ServerboundClientInformationPacket
PLAY SERVERBOUND 0x08 ServerboundCommandSuggestionPacket
@acrylic-style
acrylic-style / HelloWorld.java
Last active August 3, 2022 10:39
Draw a text using LWJGL (OpenGL 3.2 Core Profile)
package com.example.lwjgltest;
import org.joml.Matrix4d;
import org.lwjgl.glfw.GLFWErrorCallback;
import org.lwjgl.glfw.GLFWVidMode;
import org.lwjgl.opengl.GL;
import org.lwjgl.stb.STBEasyFont;
import org.lwjgl.system.MemoryStack;
import java.nio.ByteBuffer;
@acrylic-style
acrylic-style / root-password-MariaDB-docker-compose.md
Last active September 28, 2022 14:37 — forked from rordi/root-password-MariaDB-docker-compose.md
Change root password in MariaDB Docker container running with docker-compose

Change root password in MariaDB Docker container running with docker-compose

Override the entrypoint in docker-compose.yml for the MariaDB Docker container by adding:

entrypoint: mysqld_safe --skip-grant-tables --user=mysql

The start up the Docker Compose stack: