Skip to content

Instantly share code, notes, and snippets.

title = '<h3>Swashbuckler 15 (+3 TH&D), 23 Strength, specialization VS Plate Mail'
[[DamageCalculations]]
acidDamage1bonus = 0
acidDamage1number = 0
acidDamage1probability = 100
acidDamage1sides = 2
acidDamage2bonus = 0
acidDamage2number = 0
acidDamage2probability = 100
@suy
suy / linux.txt
Last active April 25, 2021 07:44
Infinity Engine Pseudo-Random Number Generator results when rolling 1d20
This file has been truncated, but you can view the full file.
9
14
19
5
12
14
5
7
3
13
@suy
suy / main.cpp
Created May 25, 2020 07:25
A simple tool to sort and print in a more human readable form the compiler output
#include <QtCore>
static void dump(const char* name, const QStringList& variable) {
QTextStream out(stdout);
out << variable.count() << " " << name << endl;
foreach (const QString& item, variable) {
out << " " << item << endl;
}
}
@suy
suy / threadpool-lingering.cpp
Created March 23, 2018 14:17
QThreadPool lingers till the end of the app, for good or bad
#include <QtCore>
class TurtleRunnable : public QRunnable
{
void run() override {
for (int i = 0; i < 15; ++i) {
qDebug("Tick %i", i);
QThread::sleep(1);
}
}
@suy
suy / problems.adoc
Last active July 30, 2018 16:21
BTRFS "no space" problem

Initially

# df -h -x tmpfs
Filesystem      Size  Used Avail Use% Mounted on
udev            7.8G     0  7.8G   0% /dev
/dev/sda1       9.4G  6.1G  3.3G  66% /
/dev/sda2       923G  439G  482G  48% /home
# btrfs fi show
Label: none  uuid: 1c8212fb-88ff-4f39-912a-5178a3547e6c
<manuelschneid3r> does QString("text") allocate exactly the necessary memory or do i have to squeeze?
<suy> qout: { QString t("text"); qDebug() << t.capacity(); }
<qout> 4
<suy> qout: { QString t("a much, much, much longer text"); qDebug() << t.capacity() << t.size(); }
<qout> 30 30
#include <QtCore>
#include <memory>
int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
auto p = std::make_shared<int>(42);
auto t = new QTimer;
t->setSingleShot(true);
@suy
suy / output.adoc
Last active July 16, 2016 08:49
runtimepath after nvim-qt startup
/home/alex/personal/configs/dotvim/init.vim|| 1
/home/alex/personal/configs/dotvim/bundle/pathogen/autoload/pathogen.vim|| 2
/usr/share/nvim/runtime/autoload/provider/python.vim|| 3
/usr/share/nvim/runtime/autoload/provider/pythonx.vim|| 4
/usr/share/nvim/runtime/autoload/provider/python3.vim|| 5
/usr/share/nvim/runtime/autoload/remote/host.vim|| 6
/home/alex/personal/configs/dotvim/bundle/submode/autoload/submode.vim|| 7
/home/alex/personal/configs/dotvim/bundle/lastnextprevious/autoload/lastnextprevious.vim|| 8
@suy
suy / appveyor.adoc
Last active January 2, 2016 21:33
Notes on using Appveyor
ifdef::env-github[]
:header: I'm on GitHub!
:star: :star:
endif::[]
ifndef::env-github[]
:header: Somewhere else.
:star: icon:star[]
endif::[]