Skip to content

Instantly share code, notes, and snippets.

View ordovician's full-sized avatar

Erik Engheim ordovician

View GitHub Profile
@ordovician
ordovician / rm-trailing-whitespace.sh
Created October 18, 2018 09:25
[Remove trailing whitespace] Allows you to do through all files in subdirecttory and remove any occurance of trailing whitespace. Make sure you got these files under version control as it will do in place replacement. #unix #shell #sed
find . -type f | xargs sed -i 's/[ \t]*$//'
@ordovician
ordovician / dump-pixmap.cpp
Created January 9, 2019 11:37
[Dump QPixmap to File] This is to help debug code where pixmaps are created #qt
#include <QtCore/QFile>
#include <QtCore/QDir>
/// Store pixmap in home directory as .png file
static void
DumpPixmapToFile(const QPixmap &pixmap) {
QString filepath = QDir::home().filePath("debug-pattern.png");
pixmap.save(filepath, "PNG");
}