Skip to content

Instantly share code, notes, and snippets.

View dolik-rce's full-sized avatar

Jan Dolinár dolik-rce

View GitHub Profile
@dolik-rce
dolik-rce / rc.sh
Last active August 4, 2016 06:04
Pár vychytávek z mého .bashrc
# Malá pythoní kalkulačka,
# stačí napsat výraz a zmáčkount Ctrl+E
bind -x "\"\\C-e\": python <<< \"
from __future__ import print_function
from math import *
from re import match, split
s = '\${READLINE_LINE//\"'\"/\"\\\\'\"}'
for x in split('[;\n]\s*', s):
try:
@dolik-rce
dolik-rce / nginx.conf
Last active April 22, 2020 18:21
Benchmark for https://github.com/knyar/nginx-lua-prometheus/pull/82, just place both files in benchmark/ directory, then execute run.sh.
daemon off;
user www-data;
pid /var/run/nginx.pid;
worker_processes 4;
include /etc/nginx/modules-enabled/*.conf;
events {}
http {
sendfile on;
tcp_nodelay on;
@dolik-rce
dolik-rce / nginx.conf
Last active May 4, 2020 11:44
Nginx-lua-prometheus benchmark #2
daemon off;
user www-data;
pid /var/run/nginx.pid;
worker_processes 4;
include /etc/nginx/modules-enabled/*.conf;
events {}
http {
sendfile on;
tcp_nodelay on;
@dolik-rce
dolik-rce / graph.svg
Created February 17, 2021 06:16
Flame graph for peg-based Kotlin parser in ctags
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dolik-rce
dolik-rce / optimizer.sh
Created February 19, 2021 11:08
Peg grammar optimizer
#!/bin/bash
# Usage: optimizer.sh [-v] <file.peg>
set -e
dbg() {
if [ "$VERBOSE" ]; then
echo "$1" > /dev/stderr
fi
@dolik-rce
dolik-rce / bobcat.svg
Created February 15, 2024 20:47
Bobcat flamegraph
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dolik-rce
dolik-rce / kotlin.c
Created August 19, 2024 06:33
Kotlin parser
This file has been truncated, but you can view the full file.
/* A packrat parser generated by PackCC 2.0.0 */
#include "general.h"
#ifdef _MSC_VER
#undef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif /* _MSC_VER */
#include <stdio.h>
#include <stdlib.h>
@dolik-rce
dolik-rce / kotlin.c
Created August 19, 2024 06:35
Optimized kotlin parser
This file has been truncated, but you can view the full file.
/* A packrat parser generated by PackCC 2.0.0 */
#include "general.h"
#ifdef _MSC_VER
#undef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif /* _MSC_VER */
#include <stdio.h>
#include <stdlib.h>
@dolik-rce
dolik-rce / toml.c
Created August 19, 2024 06:38
TOML parser
/* A packrat parser generated by PackCC 2.0.0 */
#include "general.h"
#ifdef _MSC_VER
#undef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif /* _MSC_VER */
#include <stdio.h>
#include <stdlib.h>