Skip to content

Instantly share code, notes, and snippets.

Rene Jochum pcdummy

Block or report user

Report or block pcdummy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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
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
lsv / README.md
Last active Nov 11, 2019
KNP Menu Bundle - Bootstrap 4 and Font Awesome 4
View README.md
View Accordion.qml
import QtQuick 2.4
Column {
width: parent.width
height: parent.height
property alias model: columnRepeater.model
Repeater {
id: columnRepeater
@pcdummy
pcdummy / hetzner.py
Last active Apr 27, 2018
Hetzner Mininet.
View hetzner.py
#!/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
methane / bench.py
Last active Oct 10, 2019
Benchmarking MySQL drivers (Python 3.4)
View bench.py
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
nhoad / gist:8966377
Last active Mar 7, 2019
Async stdio with asyncio
View gist:8966377
import os
import asyncio
import sys
from asyncio.streams import StreamWriter, FlowControlMixin
reader, writer = None, None
@asyncio.coroutine
def stdio(loop=None):
View ReText.conf
# ~/.config/ReText project/ReText.conf
[General]
autoSave=true
restorePreviewState=true
highlightCurrentLine=true
tabWidth=2
styleSheet=github.css
useWebKit=true
autoPlainText=false
@pawelpabich
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
matthewd / diff-configs.sh
Created Sep 30, 2011
Diff /etc files against the versions supplied in Debian packages
View diff-configs.sh
#!/bin/bash
# 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
You can’t perform that action at this time.