Skip to content

Instantly share code, notes, and snippets.

Avatar
😀
Happy

Rene Jochum pcdummy

😀
Happy
View GitHub Profile
@ktat
ktat / gist:999684
Created May 31, 2011
WebSocket perl client(select)
View gist:999684
#!/usr/bin/perl
use utf8;
use strict;
use warnings;
use Protocol::WebSocket::Handshake::Client;
use Protocol::WebSocket::Frame;
use IO::Socket;
use IO::Select;
@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
@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
{
View ReText.conf
# ~/.config/ReText project/ReText.conf
[General]
autoSave=true
restorePreviewState=true
highlightCurrentLine=true
tabWidth=2
styleSheet=github.css
useWebKit=true
autoPlainText=false
@nhoad
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
@asyncio.coroutine
def stdio(loop=None):
@methane
methane / bench.py
Last active Nov 4, 2020
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)
@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.
"""
View Accordion.qml
import QtQuick 2.4
Column {
width: parent.width
height: parent.height
property alias model: columnRepeater.model
Repeater {
id: columnRepeater
@lsv
lsv / README.md
Last active Oct 21, 2020
KNP Menu Bundle - Bootstrap 4 and Font Awesome 4
View README.md
@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(){
You can’t perform that action at this time.