Skip to content

Instantly share code, notes, and snippets.

View Uflex's full-sized avatar

Cédric Bonnier Uflex

  • FXhome Limited
  • Norwich, UK
View GitHub Profile
@Uflex
Uflex / .ackrc
Created July 17, 2015 16:02
ACK configuration file
--ignore-ack-defaults
# This is the default ackrc for ack version 2.14.
# There are four different ways to match
#
# is: Match the filename exactly
#
# ext: Match the extension of the filename exactly
#
# match: Match the filename against a Perl regular expression
@Uflex
Uflex / CharVectorDevice.h
Last active January 4, 2016 00:09
Subclass QIODevice to allow saving an image into a std::vector<char>.
#include <QIODevice>
#include <vector>
#include <algorithm>
struct CharVectorDevice : public QIODevice
{
public:
virtual bool seek(qint64 pos)
{
if (pos < 0 || pos > static_cast<qint64>(m_vector.size())) {
@Uflex
Uflex / fixOpenCV_dylibs.sh
Last active December 27, 2015 17:09
Sets all OpenCV dylibs to use absolute path (run after make install)
#!/bin/bash
#
# Fixes OpenCV to use absolute paths
#
# This script should be run ONLY ONCE, to make sure that the
# macdeployqt script will run properly (ie if it errors saying
# that a dylib could not be found)
#
@Uflex
Uflex / clang-format_config.md
Last active November 3, 2019 16:19
Configuration of clang-format for QtCreator

Clang-format in QtCreator

Edit: QtCreator 3.1 introduced a new plugin called Beautifier that supports clang-format. You still have to install the clang tools separately but you don't have to add them as external tools anymore. The plugin can be configured in the options dialog under the beautifier tab > Clang Format. Add a new style and copy the configuration below without the curly braces.

QtCreator doesn't allow using clang-format by default. Watch QTCREATORBUG-10111 for a better integration. As of today, you should use it as an external tool, either replacing your selection or the entire file. If you choose to replace the file, you will have to save it before launching the tool and QtCreator will reload the file, making it impossible to undo/redo afterwards. If you choose to replace your selection, you often have to select the whole function, otherwise you will lose the indentation; clang-format doesn't seem to k