Skip to content

Instantly share code, notes, and snippets.

View dmitryhd's full-sized avatar

Dmitry Khodakov dmitryhd

View GitHub Profile
@dmitryhd
dmitryhd / .block
Created January 24, 2023 07:17 — forked from d3noob/.block
Simple horizontal tree diagram using v4
license: mit
@dmitryhd
dmitryhd / tornado_asyncio.py
Created July 16, 2017 20:13 — forked from drgarcia1986/tornado_asyncio.py
Tornado and Asyncio Mixed example
# -*- coding: utf-8 -*-
import asyncio
import re
import asyncio_redis
import tornado.concurrent
import tornado.httpclient
import tornado.web
import tornado.platform.asyncio
@dmitryhd
dmitryhd / nginx.conf
Created May 22, 2017 19:57 — forked from foxxyz/nginx.conf
Serve current directory via nginx
# Extremely basic development setup to serve the current directory at http://localhost:9001
# Start nginx in this directory with `nginx -p . -c nginx.conf`
# Stop nginx with `nginx -p . -s stop`
events {}
http {
# Serve files with correct mimetypes on OSX
# location may have to be adjusted depending on your OS and nginx install
# include /usr/local/etc/nginx/mime.types;
@dmitryhd
dmitryhd / latency.txt
Created December 2, 2016 14:04 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@dmitryhd
dmitryhd / supervisord-example.conf
Created August 15, 2016 16:41 — forked from didip/supervisord-example.conf
Example configuration file for supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon