Skip to content

Instantly share code, notes, and snippets.

@mistic100
mistic100 / simpletextimage.class.php
Created March 8, 2014 15:25
[PHP] Generate a very simple image containing some text
<?php
/**
* Generate a very simple image containing some text
*
* Basic usage:
* (new SimpleTextImage('Hello world!'))->render();
*
* All functionalities:
* (new SimpleTextImage())
* ->setText('Hello world!')
@mistic100
mistic100 / silkscreen.class.php
Last active August 29, 2015 13:57
[PHP] Write text on image with silkscreen font
<?php
/**
* Write text on image with silkscreen font http://kottke.org/plus/type/silkscreen
*
* Usage:
* $img = imagecreatetruecolor(65, 15);
* $bg = imagecolorallocate($img, 0, 0, 0);
* $fg = imagecolorallocate($img, 255, 255, 255);
*
* silk::write($img, 5, 5, 'Hello world', $fg, 1, false, 0);
@mistic100
mistic100 / delete-installer.iss
Created August 9, 2014 10:12
[InnoSetup] Delete installer on next startup
[Code]
// mark installer for deletion if argument "-delete-installer" is present
procedure DeinitializeSetup();
var i: integer;
begin
for i:= 0 to ParamCount do
begin
if ParamStr(i) = '-delete-installer' then
begin
RestartReplace(ExpandConstant('{srcexe}'), '');
@mistic100
mistic100 / delete-config.iss
Last active August 29, 2015 14:05
[InnoSetup] Ask for delete config file on uninstall
#define SettingsFile "settings.xml"
[CustomMessages]
english.DeleteSettings=Delete settings file?
[Code]
// ask for delete config file during uninstall
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
case CurUninstallStep of
@mistic100
mistic100 / Batch SVN to Git.md
Last active August 29, 2015 14:09
[Node] Batch conversion of SVN directories to Git repositories

Requirements

  • node
  • npm
  • svn
  • git
  • git-svn

Usage

  1. npm install
  2. Create empty repositories on Github
@mistic100
mistic100 / qwidgetblinker.hpp
Created January 3, 2015 12:37
[Qt/C++] Utility allowing to make any QWidget blink
#ifndef QWIDGETBLINKER_H
#define QWIDGETBLINKER_H
#include <QWidget>
#include <QTimeLine>
#include <QEvent>
/**
* @brief Utility allowing to make any QWidget blink
@mistic100
mistic100 / movies-db.php
Created February 7, 2015 09:33
[PHP] A one-file videos files indexer connected to TheMovieDatabase (Windows only)
<?php
/**
* My Movie Database - A Windows Movie Indexer
*
* @author: Damien "Mistic" Sorel - http://strangeplanet.fr
* @license: GNU General Public License
* @since: 25/05/2013
*
* @version: 1.1.0
* @date: 25/07/2013
@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
*/