Skip to content

Instantly share code, notes, and snippets.

View Alexander01998's full-sized avatar

Alexander01998 Alexander01998

View GitHub Profile
@Alexander01998
Alexander01998 / stacktrace-to-string.java
Created May 11, 2015 12:34
Converts a stack trace to a String.
StringWriter traceWriter = new StringWriter();
e.printStackTrace(new PrintWriter(traceWriter));
String trace = traceWriter.toString();
@arthurattwell
arthurattwell / random
Last active June 27, 2024 01:58
Jekyll include for generating random strings
{% capture random %}
{% comment %}This include generates a random string.
Save it to _includes. Then use {% include random %}
to get an 8-character string of numbers and letters.
Optionally:
* Specify the length of string you want. E.g.
{% include random length=16 %} or
{% include random length="16" %}
@JamiesWhiteShirt
JamiesWhiteShirt / cursegradle.md
Last active October 18, 2021 15:59
How to publish your Fabric mod with CurseGradle

How to publish your Fabric mod with CurseGradle

CurseGradle is a Gradle plugin that lets you publish artifacts to CurseForge. Consult the CurseGradle wiki for the full details. It works out of the box for ForgeGradle projects, but requires a bit of configuration for Fabric projects, which is the subject of this gist.

CurseGradle will assume the environment is a ForgeGradle environment, so its integration has to be manually switched off. Without ForgeGradle, CurseGradle doesn't know which Minecraft version you are working with, so it has to be specified manually. The correct main artifact is the output of the remapJar task.

@lrvick
lrvick / github-troll.md
Last active May 3, 2024 16:20
Trolling Github's DMCA repo with their own security flaws.
@johnidm
johnidm / README.md
Last active July 10, 2024 12:10
SQLite - Use two Database in-memory - Example in SQLAlchemy

Using two SQLite database connection in-memory.

from sqlalchemy import create_engine, MetaData
from sqlalchemy import text
from sqlalchemy.orm import DeclarativeBase

from sqlalchemy import select
from sqlalchemy import insert
from sqlalchemy.orm import Mapped, mapped_column