Skip to content

Instantly share code, notes, and snippets.

@mistic100
mistic100 / qlineeditcolor.hpp
Created December 26, 2015 20:57
[Qt/C++] A QLineEdit used as a color picker
#ifndef QLINEEDITCOLOR
#define QLINEEDITCOLOR
#include <QtWidgets/QLineEdit>
#include <QColorDialog>
#include <QEvent>
/**
* @brief A QLineEdit combined with a QColorDialog
* @signal colorChanged(QColor)
@mistic100
mistic100 / qcomboboxext.hpp
Last active December 26, 2015 20:58
[Qt/C++] QComboBox With direct access to item data
#ifndef QCOMBOBOXEXT_H
#define QCOMBOBOXEXT_H
#include <QWidget>
#include <QComboBox>
/**
* @brief QComboBox With direct access to item data
* @signal currentDataChanged(QVariant)
@mistic100
mistic100 / safe_version_compare.php
Last active January 2, 2016 20:29
[PHP] Compare versions with alphabetical components
<?php
/**
* Compare versions with alphabetical components.
* Usesversion_compare after having converted single chars to their decimal values.
* Needed because version_compare does not understand versions like '2.5.c'.
*
* @param string $a
* @param string $b
* @param string $op
*/
@mistic100
mistic100 / file_exists_strict.php
Last active January 2, 2016 20:29
[PHP] Check if a file exists but is not dir
<?php
/**
* Check if a file exists but is not dir
*
* @param file
* @return bool
*/
function file_exists_strict($file)
{
return file_exists($file) && !is_dir($file);
@mistic100
mistic100 / array_pos.php
Last active January 2, 2016 20:29
[PHP] Search a string in array values
<?php
/**
* Search a string in array values
*
* @param string $needle
* @param array $haystack
* @param bool $match_all - return all instances
* @param bool $preg_mode - search in PCRE mode
* @return mixed|array
*/
@mistic100
mistic100 / qtabwidgetext.h
Created September 4, 2016 16:08
[Qt/C++] QTabWidget which allow to set the current tab by its name
#ifndef QTABWIDGETEXT
#define QTABWIDGETEXT
#include <QTabWidget>
/**
* @brief QTabWidget which allow to set the current tab by its name
*/
class QTabWidgetExt : public QTabWidget
{

Read

$ exiftool -xmp -b file.jpg > data.xmp

Write

$ exiftool -tagsfromfile data.xmp -all:all file.jpg
@mistic100
mistic100 / custom-link.iss
Created August 9, 2014 10:24
[InnoSetup] Custom link in installer footer
ffmpeg -i video.mp4 -vf "select=eq(pict_type\,I)" -vsync vfr -qscale:v 2 still-%02d.jpg
@mistic100
mistic100 / IdenticonPlus.php
Last active February 18, 2019 07:33
PHP implementation of Don Park Identicon algorithm with additional shapes and variations
<?php
/**
* Identicon++
*
* @description: PHP implementation of Don Park Identicon algorithm with additional shapes and variations.
*
* @author: Damien "Mistic" Sorel - http://strangeplanet.fr
* @license: MIT
* @version: 2.0.0
* @date: 21/05/2015