Skip to content

Instantly share code, notes, and snippets.

View aalex's full-sized avatar

Alexandre Quessy aalex

View GitHub Profile
import QtQuick 2.0
import QtWebSockets 1.0
/**
* Informations about the current user.
*/
Item {
property string gender: null
property string culture: null
property int age: null
version: '2'
services:
portainer:
image: portainer/portainer
restart: always
ports:
- "9000:9000"
command: -H unix:///var/run/docker.sock
volumes:
@aalex
aalex / txwindow.py
Created September 11, 2017 21:53
Example of using the qt5reactor - it hangs when we close the main window on Windows
#!/usr/bin/python3
"""
Prototype of a window with twisted
"""
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QKeySequence
from PyQt5.QtWidgets import (
QAction, QActionGroup, QApplication, QFrame, QLabel, QMainWindow,
TEMPLATE = app
QT += qml quick
QT += quickcontrols2
CONFIG += c++11
SOURCES += main.cpp
RESOURCES += qml.qrc
#include <QGuiApplication>
#include <QQuickStyle>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QQuickStyle::setStyle("Material");
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import QtQuick.Window 2.2
import QtQuick.Controls.Material 2.0
Window {
visible: true
width: 320
height: 240
@aalex
aalex / gist:3e0e641624e5537d55b4
Created August 29, 2014 12:55
tiki-index.php output
<!-- TPL: /home/aalex/public/swingster.net/public/templates/wiki-plugins/wikiplugin_trackerlist.tpl -->
<div id="wptrackerlist1-3-div" ><input type="hidden" name="offset" value="0"><input type="hidden" name="count" value="6"><div class="table-responsive"><div class="table"><table class="table table-striped table-hover normal wikiplugin_trackerlist" id="wptrackerlist1-3"><thead><tr><th class="auto" style="width:20px;">&nbsp;</th><th class="auto field1"><a href="/tiki-index.php?page=Community+Members+HomePage&amp;session_filters=y&amp;tr_sort_mode3=f_1_asc" style='text-decoration:none;'>Summary</a></th><th class="auto field3"><a href="/tiki-index.php?page=Community+Members+HomePage&amp;session_filters=y&amp;tr_sort_mode3=f_3_asc" style='text-decoration:none;'>Priority</a></th><th class="auto field4"><a href="/tiki-index.php?page=Community+Members+HomePage&amp;session_filters=y&amp;tr_sort_mode3=f_4_asc" style='text-decoration:none;'>Description</a></th><th class="auto field5"><a href="/tiki-index.php?p
@aalex
aalex / gist:6cc2acf343099c9e3c2f
Created August 17, 2014 16:18
MapMap: need help with CDBS, Qmake and debian/install rules
I am currently doing some efforts to package my MapMap video mapping application for Ubuntu. Once this is done, I will happily contribute this to Debian! I am one of the upstream authors. MapMap is a Qt4 (or Qt5) application written in C++ and packaged with qmake. I use use CDBS to debianize this package. Now, I think I have only one problem left:
The "mapmap" binary and the "mapmap.desktop" desktop file are not included in the Ubuntu package!
Now, some technical details: I tried both to install the files that are relative to the root, and the pseudo-installed files. The files built by qt4-qmake should be installed in /usr/bin and /usr/share/applications, thanks to my patch. (see below) For some reason, in both cases it doesn't work.
The upstream .pro file:
https://github.com/mapmapteam/ubuntu-mapmap/blob/master/mapmap.pro
And a patch I apply to fix the upstream .pro file:
@aalex
aalex / gist:c9bf8382b831e033abe1
Created August 2, 2014 01:18
How to display icons in Tiki (SVG, PNG, fonts)
Hello everyone,
In this email, I will suggest a solution for how to display icons in Tiki. See this page: https://themes.tiki.org/Icons+SVG+or+Fonts
But first, I will try to summarize how it currently works, and what objectives would be nice for Tiki and icons in a near future.
The current state in tiki:
* In the templates, or in the PHP code, developers often call the {icon} Smarty function, or the smarty_function_icon PHP function. (backend: PNG)
* That function can receive a "class" attribute that can contain something like "fa fa-comments" as a value so that we use Font Awesome. (backend: font)
* In the templates, they sometimes simply put an HTML element such as this: <span class="glyphicon glyphicon-globe" title="Language options"/>. (backend: font)
Objectives:
mysql> describe users_users;
+---------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+--------------+------+-----+---------+----------------+
| userId | int(8) | NO | PRI | NULL | auto_increment |
| email | varchar(200) | YES | | NULL | |
| login | varchar(200) | NO | UNI | | |
| password | varchar(30) | YES | | | |
| provpass | varchar(30) | YES | | NULL | |
| default_group | varchar(255) | YES | | NULL | |