Skip to content

Instantly share code, notes, and snippets.

View danielkraic's full-sized avatar

Daniel Kraic danielkraic

View GitHub Profile
# vim
:set number
:syn on
~/.vimrc: https://github.com/danielkraic/dotfiles/blob/master/vimrc
## files
vim file
vim +10 file
@danielkraic
danielkraic / logger-rsyslog.py
Last active July 12, 2024 08:48
python app with loggin to rsyslog
"""
rsyslog config: /etc/rsyslog.d/my-sample.conf:
$template AppLogFormat, "%TIMESTAMP:::date-pgsql%%TIMESTAMP:27:32:date-rfc3339%(%syslogseverity-text%)%msg%\n"
if $app-name == 'my-sample-app' then -/var/log/my-sample-app/app.log;AppLogFormat
& ~
"""
from __future__ import print_function
@danielkraic
danielkraic / goole-benchmark-test01.cpp
Created September 2, 2016 17:57
google benchmark c++ example
#include <iostream>
#include <sstream>
#include <benchmark/benchmark.h>
using namespace std;
static void BM_bench01(benchmark::State& st) {
while (st.KeepRunning()) {
std::stringstream s;
for (size_t i = 0; i < st.range(0); i++) {