Skip to content

Instantly share code, notes, and snippets.

View ReneHollander's full-sized avatar
🏠
Working from home

Rene Hollander ReneHollander

🏠
Working from home
  • Google
  • Switzerland
View GitHub Profile
@ReneHollander
ReneHollander / gist:fd275af2b8a566fd95d163e9002b6e07
Created October 29, 2023 13:14
hand rolled parser performance
│ Parse │ ParseNative │ ParseCustom │
│ sec/op │ sec/op vs base │ sec/op vs base │
*/compress,_gzip 6688.0n ± 6% 5362.0n ± 2% -19.83% (p=0.000 n=10) 184.9n ± 1% -97.24% (p=0.000 n=10)
*/#00 844.50n ± 3% 994.80n ± 2% +17.80% (p=0.001 n=10) 21.79n ± 0% -97.42% (p=0.000 n=10)
*/identity 2554.00n ± 9% 2520.50n ± 2% ~ (p=0.271 n=10) 97.27n ± 2% -96.19% (p=0.000 n=10)
*/br;q=0.555 5293.5n ± 2% 4208.5n ± 2% -20.50% (p=0.000 n=10) 150.0n ± 0% -97.17% (p=0.000 n=10)
*/br;q=0.0 5215.0n ± 4% 4124.0n ± 1% -20.92% (p=0.000 n=10) 144.2n ± 1% -97.24% (p=0.000 n=10)
*/br;q=1.0 5242.5n ± 9% 4167.0n ± 4% -20.52% (p=0.000 n=10) 145.8n ±
@ReneHollander
ReneHollander / main.cpp
Created December 29, 2016 16:08
Skia on the Raspberry Pi
#include <iostream>
#include <assert.h>
#include <stdio.h>
#include <cstdio>
#include <bcm_host.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
/*
* Copyright 2014 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkTypes.h"
#include "gl/GrGLInterface.h"
#include "gl/GrGLAssembleInterface.h"
@ReneHollander
ReneHollander / camera.py
Created November 28, 2015 21:19
A camera for pyglet with euclid
from math import sin, cos, pi
from euclid import *
from pyglet.window import key, mouse, pyglet
halfpi = pi / 2.0
class Camera():
def __init__(self, window, position=Vector3(), yaw=0.0, pitch=0.0, callbacks=None):
@ReneHollander
ReneHollander / pr0gramm-download.user.js
Created March 27, 2018 21:03
pr0gramm Favoriten Download
// ==UserScript==
// @name pr0gramm Favoriten Download
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Rene8888
// @match http://pr0gramm.com/user/*/likes
// @grant GM_xmlhttpRequest
// @grant GM_download
// @connect pr0gramm.com
#include <libopencm3/stm32/gpio.h>
#include <libopencm3/stm32/dac.h>
#include <libopencm3/stm32/dma.h>
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/stm32/timer.h>
#define SINE_TABLE_LEN 256
const uint16_t sine_table[SINE_TABLE_LEN] = { // now with actual sine
2047, 2097, 2147, 2198, 2248, 2298, 2347, 2397, 2446, 2496, 2544, 2593, 2641, 2689, 2737, 2784, 2830, 2877, 2922, 2967, 3012, 3056, 3099, 3142, 3184, 3226, 3266, 3306, 3346, 3384, 3422, 3458, 3494, 3530, 3564, 3597, 3629, 3661, 3691, 3721, 3749, 3776, 3803, 3828, 3852, 3875, 3897, 3918, 3938, 3957, 3974, 3991, 4006, 4020, 4033, 4044, 4055, 4064, 4072, 4079, 4084, 4088, 4092, 4093, 4094, 4093, 4092, 4088, 4084, 4079, 4072, 4064, 4055, 4044, 4033, 4020, 4006, 3991, 3974, 3957, 3938, 3918, 3897, 3875, 3852, 3828, 3803, 3776, 3749, 3721, 3691, 3661, 3629, 3597, 3564, 3530, 3494, 3458, 3422, 3384, 3346, 3306, 3266, 3226, 3184, 3142, 3099, 3056, 3012, 2967, 2922, 2877, 2830, 2784, 2737, 2689, 2641, 2593, 2544, 2496, 2446, 2397, 2347, 2298, 2248,
UnlinkMKV
Options
chapters: 1
cleanup: 0
edition: 1
ffmpeg: /usr/bin/ffmpeg
fixaudio: 0
fixaudiotemplate: -map 0 -acodec ac3 -ab 320k
fixsubtitles: 1
fixvideo: 0
19-1-7 19:52:47.5|Trace|CommandQueueManager|Updating command status
19-1-7 19:52:47.5|Trace|EventAggregator|Publishing CommandUpdatedEvent
19-1-7 19:52:47.5|Trace|EventAggregator|CommandUpdatedEvent -> CommandModule
19-1-7 19:52:47.5|Trace|EventAggregator|CommandUpdatedEvent <- CommandModule
19-1-7 19:52:47.5|Trace|EventAggregator|Publishing CommandExecutedEvent
19-1-7 19:52:47.5|Trace|EventAggregator|CommandExecutedEvent -> TaskManager
19-1-7 19:52:47.5|Trace|EventAggregator|CommandExecutedEvent <- TaskManager
19-1-7 19:52:47.5|Trace|EventAggregator|CommandExecutedEvent -> TaskModule
19-1-7 19:52:47.5|Trace|EventAggregator|CommandExecutedEvent <- TaskModule
19-1-7 19:52:47.5|Trace|CommandExecutor|DeleteLogFilesCommand <- DeleteLogFilesService [00:00:00.0125560]
19-1-7 19:52:56.8|Debug|DownloadDecisionMaker|Processing release '[U3-Web] Dororo 2019 / [EP01][AMZN WEB-DL 1920x1080 AVC E-AC-3] ( Tezuka Osamu Works)' from 'Nyaa'
19-1-7 19:52:56.8|Debug|Parser|Parsing string '[U3-Web] Dororo 2019 / [EP01][AMZN WEB-DL 1920x1080 AVC E-AC-3] ( Tezuka Osamu Works)'
19-1-7 19:52:56.9|Trace|Parser|^(?<title>.+?)?(?:(?:[-_\W](?<![()\[!]))*(?<season>(?<!\d+|\(|\[|e|x)\d{2})(?<episode>(?<!e|x)\d{2}(?!p|i|\d+|\)|\]|\W\d+|\W(?:e|ep|x)\d+)))+(\W+|_|$)(?!\\)
19-1-7 19:52:56.9|Debug|Parser|Episode Parsed. Dororo - S20E19
19-1-7 19:52:56.9|Debug|Parser|Language parsed: English
19-1-7 19:52:56.9|Debug|QualityParser|Trying to parse quality for [U3-Web] Dororo 2019 / [EP01][AMZN WEB-DL 1920x1080 AVC E-AC-3] ( Tezuka Osamu Works)
19-1-7 19:52:56.9|Debug|Parser|Quality parsed: WEBDL-1080p v1
19-1-7 19:52:56.9|Debug|Parser|Release Group parsed: U3-Web
19-1-7 19:52:56.9|Debug|ParsingService|No matching series Dororo
@ReneHollander
ReneHollander / get_ambient_values.py
Last active January 1, 2019 22:26
RaspberryPi read DHT22 with Adafruit_Python_DHT
#!/usr/bin/python3
import sys
import Adafruit_DHT
sensor = Adafruit_DHT.DHT22
sensor_name = sys.argv[1]
pin = sys.argv[2]
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin, delay_seconds=3)