Skip to content

Instantly share code, notes, and snippets.


Rene Jochum pcdummy

View GitHub Profile
View Accordion.qml
import QtQuick 2.9
import QtQuick.Controls 2.2
Column {
width: parent.width
height: parent.height
property alias model: columnRepeater.model
ListView {
ejahandar / IteratorBenchmark.cpp
Created Mar 14, 2018
A Benchmark for Qt's Vector/List/Map iterators vs simple arrays
View IteratorBenchmark.cpp
#include <QDateTime>
#include <QMap>
#include <QVector>
#include <QList>
#include <QDebug>
#define SIZE 10000000
int array[SIZE];
int main(){
lsv /
Last active Dec 23, 2020
KNP Menu Bundle - Bootstrap 4 and Font Awesome 4
View Accordion.qml
import QtQuick 2.4
Column {
width: parent.width
height: parent.height
property alias model: columnRepeater.model
Repeater {
id: columnRepeater
pcdummy /
Last active Apr 27, 2018
Hetzner Mininet.
#!/usr/bin/env python
Helper to create a Hetzner root server style Network.
At Hetzner the gateway blocks alls MAC's except the
one of the route server, this means you need to proxy_arp
your virtual hosts.
Known bugs:
- pingAll doesn't seem to work right with this.
methane /
Last active Jan 23, 2021
Benchmarking MySQL drivers (Python 3.4)
from __future__ import print_function
import time
def query_10k(cur):
t = time.time()
for _ in range(10000):
cur.execute("SELECT 1,2,3,4,5")
res = cur.fetchall()
assert len(res) == 1
assert res[0] == (1,2,3,4,5)
nhoad / gist:8966377
Last active Jun 23, 2020
Async stdio with asyncio
View gist:8966377
import os
import asyncio
import sys
from asyncio.streams import StreamWriter, FlowControlMixin
reader, writer = None, None
def stdio(loop=None):
View ReText.conf
# ~/.config/ReText project/ReText.conf
pawelpabich / LogModule.cs
Created Jul 7, 2012
Log4Net and NLog modules for Autofac
View LogModule.cs
using System;
using System.Linq;
using Autofac;
using Autofac.Core;
using NLog;
using log4net;
using LogManager = NLog.LogManager;
namespace AutofacIdea
matthewd /
Created Sep 30, 2011
Diff /etc files against the versions supplied in Debian packages
# This script will make a best-effort attempt at showing modifications
# to package-provided config files on a Debian system.
# It's subject to some pretty significant limitations: most notably,
# there's no way to identify all such config files. We approximate the
# answer by looking first at dpkg-managed conffiles, and then hoping
# that most of the time, if maintainer scripts are managing files
# themselves, they're using ucf. So, DO NOT TRUST THIS SCRIPT to find