Skip to content

Instantly share code, notes, and snippets.

View dridk's full-sized avatar

sacha schutz dridk

View GitHub Profile
@dridk
dridk / qml_model_python.py
Created December 29, 2020 22:51
qml and python model integration with PySide2
from PySide2.QtWidgets import *
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtQuick import QQuickView
import sys
import random
class PlayerModel(QAbstractListModel):
"""
@dridk
dridk / Pyside2_altair.py
Last active December 30, 2020 04:58
pip install PySide2 altair vega_datasets
from PySide2.QtWidgets import *
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWebEngineWidgets import QWebEngineView, QWebEngineSettings
import sys
import altair as alt
import pandas as pd
from vega_datasets import data
@dridk
dridk / RangeSlider.py
Last active February 1, 2024 08:59
The following code creates a range slider as a Qt widget with a native looks and feel
from PySide2.QtWidgets import *
from PySide2.QtCore import *
from PySide2.QtGui import *
import sys
class RangeSlider(QWidget):
def __init__(self, parent=None):
super().__init__(parent)
@dridk
dridk / dispatcher.py
Last active April 22, 2019 15:41
dispatcher cutevariant
class QueryPluginWidget(PluginWidget):
""" Base class for all query plugin """
query_changed = Signal() # Signal to emit if UI change the query
@property
def query(self):
return self._query
@query.setter
@dridk
dridk / cpp
Created September 3, 2018 22:35
std::bind and std::function
#include <iostream>
#include <typeinfo>
#include <functional>
#include <vector>
using namespace std;
class Test
{
public :
@dridk
dridk / test.cpp
Last active September 3, 2018 22:35
std::bind and std::function
#include <iostream>
#include <typeinfo>
#include <functional>
#include <vector>
using namespace std;
class Test
{
@dridk
dridk / orm.cpp
Created September 1, 2018 17:55
CRTP inheritance with static fields
#include <iostream>
#include <map>
#include <string>
#include <list>
using namespace std;
// =========== Classe de base: caché a l'utilisateur ==================================
template <typename T>
class Base
{
@dridk
dridk / main.cpp
Last active May 7, 2019 11:43
SQL parser with spirit X3 in C++
#include <boost/spirit.hpp>
#include <string>
#include <typeinfo>
namespace VQL
{
template <typename Iterator>
auto parse(Iterator begin, Iterator end, bool& success)
@dridk
dridk / gist:291da3be27ecfa409fb4af6f0cce822b
Created March 22, 2017 12:43
Denovo & recessif mutation selection with variant_tools
#!/bin/bash
pwd
MAMAN="maman.vcf.gz"
PAPA="pere.vcf.gz"
ENFANT="enfant.vcf.gz"
DP_MAX=50
EXAC_AF=0.001
# initialize vtools prj
#ifndef MATABLEVIEW_H
#define MATABLEVIEW_H
#include <QTableView>
class MaTableView : public QTableView
{
Q_OBJECT
public:
explicit MaTableView(QWidget *parent = 0);