Skip to content

Instantly share code, notes, and snippets.

Avatar

Alejandro Exojo suy

View GitHub Profile
@suy
suy / main.cpp
Created May 25, 2020
A simple tool to sort and print in a more human readable form the compiler output
View main.cpp
#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 Mar 23, 2018
QThreadPool lingers till the end of the app, for good or bad
View threadpool-lingering.cpp
#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 Jul 30, 2018
BTRFS "no space" problem
View problems.adoc

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
View gist:2ef689ec42d71e3633d81f673ade0382
<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
View capture-shared-pointer.cpp
#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 Jul 16, 2016
runtimepath after nvim-qt startup
View output.adoc
/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 Jan 2, 2016
Notes on using Appveyor
View icon-workaround.adoc
ifdef::env-github[]
:header: I'm on GitHub!
:star: :star:
endif::[]
ifndef::env-github[]
:header: Somewhere else.
:star: icon:star[]
endif::[]
View gist:63e96915d859183e8c39
SYSCALL(args) = return
thread_selfid(0x6000003165C0, 0x60000040B630, 0x6000020F4B80) = 53886 0
csops(0x0, 0x0, 0x7FFF56778278) = 0 0
issetugid(0x0, 0x0, 0x7FFF56778278) = 0 0
shared_region_check_np(0x7FFF567761B8, 0x0, 0x7FFF56778278) = 0 0
stat64("/usr/local/lib/libosxfuse_i64.2.dylib\0", 0x7FFF56777078, 0x7FFF56778278) = 0 0
open("/usr/local/lib/libosxfuse_i64.2.dylib\0", 0x0, 0x0) = 3 0
pread(0x3, "\312\376\272\276\0", 0x1000, 0x0) = 4096 0
pread(0x3, "\317\372\355\376\a\0", 0x1000, 0x8C000) = 4096 0
mmap(0x1095C0000, 0x1F000, 0x5, 0x12, 0x3, 0x8C000) = 0x1095C0000 0
View gist:99d2efc63a8711e4bdf5
All packages are already installed and there is nothing to restore.
NuGet package restore finished.
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
1> Checking Build System
1> CMake does not need to re-run because C:/Users/Alex/Documents/helloworld/json/build/CMakeFiles/generate.stamp is up-to-date.
2>------ Build started: Project: json_unit, Configuration: Debug Win32 ------
2> Building Custom Rule C:/Users/Alex/Documents/helloworld/json/CMakeLists.txt
2> CMake does not need to re-run because C:\Users\Alex\Documents\helloworld\json\build\CMakeFiles\generate.stamp is up-to-date.
2> unit.cpp
2>C:\Users\Alex\Documents\helloworld\json\src\json.hpp(2358): error C2061: syntax error: identifier 'value_type'
You can’t perform that action at this time.