Skip to content

Instantly share code, notes, and snippets.

View romank0's full-sized avatar

Roman Konoval romank0

View GitHub Profile
@romank0
romank0 / README.md
Created February 12, 2024 17:57 — forked from RichardBronosky/README.md
A homebrew formula to build vim with support for pyenv version of python

A homebrew formula to build vim with support for pyenv version of python

Build

  1. Patch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/vim.rb
  2. Build
    brew reinstall --verbose --debug --build-from-source vim
  3. Locate your dynamic library with find /Users/bronoric/.pyenv/ -name '*libpython3*.dylib'
    • It's probably going to contain darwin in the path.
@romank0
romank0 / self-signed-certificate-with-custom-ca.md
Created February 21, 2022 17:15 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@romank0
romank0 / gist:74a49d44f637de5a9df32e690765320b
Created January 19, 2022 22:45
mysql search with order by
create table t (
user_id int,
username text,
surname text,
age int,
aboutme text,
sex bool,
city int
);
SELECT
nspname as schemaname,
c.relname::text,
pg_size_pretty(pg_relation_size(c.oid)) as "size",
pg_size_pretty
(
case when c.reltoastrelid > 0
then
pg_relation_size(c.reltoastrelid)
else 0 end
@romank0
romank0 / long_running_task.py
Created November 15, 2017 11:05
long running task
@task(routing_key="low_priority", queue="low_priority", acks_late=True)
def long_running():
import os
from time import sleep
while not os.path.isfile('/Users/romanko/stop'):
logger.info('no file: waiting 5 seconds')
sleep(5)
logger.info('file exists: exiting')
#!/bin/bash
# stdin should be integers, one per line.
# command line perncentiles e.g. 75 90 95
percentiles=$*
tmp="$(mktemp -t percentileXXXX)"
total=$(sort -n | tee "$tmp" | wc -l)
for percentile in $percentiles
@romank0
romank0 / latency.txt
Created October 13, 2016 17:44 — 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
#include <Timer.h>
#include <IRremote.h>
#include <Servo.h>
#define irPin 5
#define motorASpeedPin 10
#define motorAIn1Pin 9
#define motorAIn2Pin 8
@romank0
romank0 / 1.py
Last active September 22, 2015 14:33
class Parent(object):
conf = {}
def __init__(self, *args, **kwargs):
type(self).conf = defaultdict(
None, **super(type(self), self).conf)
super(Parent, self).__init__(*args, **kwargs)
@classmethod
def set_param(cls, name, value):

Keybase proof

I hereby claim:

  • I am romank0 on github.
  • I am romanko (https://keybase.io/romanko) on keybase.
  • I have a public key whose fingerprint is 1BB3 F9FF D0B0 685D BF2A EC9F 14BE 6262 EEFD E2E0

To claim this, I am signing this object: