Skip to content

Instantly share code, notes, and snippets.

@bluetech
bluetech / gist:ad130434c91ed5809156
Created July 3, 2015 23:01
warnings from libxkbcommon for kragen/xcompose as of b2e2ed153c6b8ea714753b716d46673557fa4ffe
xkbcommon: WARNING: /home/ran/.XCompose:14:40: this compose sequence already exists; overriding
xkbcommon: WARNING: /home/ran/.XCompose:16:43: a sequence already exists which is a prefix of this sequence; overriding
xkbcommon: WARNING: /home/ran/.XCompose:33:39: this compose sequence already exists; overriding
xkbcommon: WARNING: /home/ran/.XCompose:37:41: this compose sequence already exists; overriding
xkbcommon: WARNING: /home/ran/.XCompose:43:43: this compose sequence already exists; overriding
xkbcommon: WARNING: /home/ran/.XCompose:47:38: this compose sequence already exists; overriding
xkbcommon: WARNING: /home/ran/.XCompose:48:38: this compose sequence already exists; overriding
xkbcommon: WARNING: /home/ran/.XCompose:50:42: this compose sequence already exists; overriding
xkbcommon: WARNING: /home/ran/.XCompose:51:47: this compose sequence already exists; overriding
xkbcommon: WARNING: /home/ran/.XCompose:52:38: this compose sequence already exists; overriding
@bluetech
bluetech / mask.c
Last active July 11, 2018 15:03
Websocket masking comparison
// gcc -O3 -march=native mask.c -o mask
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <immintrin.h>
@bluetech
bluetech / client.py
Last active December 12, 2017 10:14
Trio #369
import itertools
import logging
import trio
import attr
import protocol
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger('client')
@bluetech
bluetech / test.py
Last active May 30, 2018 18:49
Thread overhead
from subprocess import Popen
from concurrent.futures import ThreadPoolExecutor
from os import waitpid
import time
import asyncio
start = time.time()
for i in range(3000):
p1 = Popen(['/bin/true'])
@bluetech
bluetech / flake8_commas.py
Created January 14, 2023 17:38
Cleaned up flake8-commas
from typing import Iterator, TypedDict
import collections
import dataclasses
import enum
import tokenize
# A parenthesized expression list yields whatever that expression list
# yields: if the list contains at least one comma, it yields a tuple;
# otherwise, it yields the single expression that makes up the expression