Skip to content

Instantly share code, notes, and snippets.

View Enmk's full-sized avatar
🇺🇦
Hacking space-time

Vasily Nemkov Enmk

🇺🇦
Hacking space-time
View GitHub Profile
  1. Нужно написать по адресу "kijow.amb.wk@msz.gov.pl" (это консульство Польского посольства в Киеве) письмо с описанием ситуации и просьбой получить гуманитарную визу. Стоит оставить номер телефона, обычно именно звонят (в моем случае отвечали на письма очень быстро, т.к. писал на польском, и телефон не понадобился). Назначат дату и время визита в консульство

  2. Собрать документы:

    • фотография как на шенген
    • распечатанная анкета (см. пункт 4)
    • страховка на весь срок запрашиваемой визы (т.е. на год). Предоставить нужно будет копию полиса и копию чека об оплате (копия чека для Украины обязательна). Скажете, что на национальную визу в Польшу (т.е. рассчитываете в сумме пребывать там 365 дней, а не полгода, как в шенгенскоой), в страховых всё знают
    • паспорт и копия последней страницы + страниц с предыдущими шенгенскими и национальными визами за 5 лет. Если меняли паспорт недавно, то распечатайте скрины/фото старого паспорта и страниц с визами оттуда
  • документы, подтверждающие полит. пре
@Enmk
Enmk / low_cardinality_wire.md
Last active April 6, 2020 18:46
ClickHouse LowCardinaity wire protocol breakdown example
Column with values:
FooBar, 1, 2, Foo, 4, Bar, Foo, 7, 8, Foo

Is sent to client as:
\x01\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x06\x46\x6f\x6f\x42\x61\x72\x01\x31\x01\x32\x03\x46\x6f\x6f\x01\x34\x03\x42\x61\x72\x01\x37\x01\x38\x0a\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x04\x07\x08\x04

Breakdown:
\x01\x00\x00\x00\x00\x00\x00\x00 // version
\x00\x06\x00\x00\x00\x00\x00\x00 // index serialization version: index type = 0 (UInt8) HasAdditionalKeys = true, NeedUpdateDictionary = true
@Enmk
Enmk / type_info.h
Created February 28, 2020 06:20
Sample of conerting values of one type to another, in support of https://github.com/ClickHouse/clickhouse-odbc/pull/255
#include <cstdio>
#include <iostream>
#include <cstdint>
#include <typeinfo>
#include <cstdlib>
#include <cmath>
#include <type_traits>
#include <string>
#include <utility>

One of our customers recently had a problem using CickHouse: the simple workflow of load-analyze-present wasn't as efficient as they were expecting. The body of the problem was with loading and presenting IPv4 and IPv6 addresses, which are traditionally stored in ClickHouse as UInt32 and FixedString(16) columns. These types have many advantages, like compact footprint and ease of comparing values. But they also have shortcomings that prompted us to seek a better solution.

For example, imagine that you want to load your dataset with IPv4-values into a table. It generally looks like the following. We just show IPv4, but IPv6 values are treated analogously.

INSERT INTO hits_old (url, from) VALUES 
('https://wikipedia.org',IPv4StringToNum('116.253.40.133'))
('https://clickhouse.yandex',IPv4StringToNum('183.247.232.58'))
('https://clickhouse.yandex/docs/en/', IPv4StringToNum('116.106.34.242'));
@Enmk
Enmk / Debugging go in Docker.md
Last active April 3, 2019 12:38
Debugging golang code in docker with VS Code step-by-step
https://github.com/golangci/golangci-lint
golangci-lint run
@Enmk
Enmk / launch.json
Created November 20, 2018 09:18
VS Code: Multy back build + debug
// based on https://github.com/Microsoft/vscode-go/wiki/Debugging-Go-code-using-VS-Code
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"preLaunchTask": "build project",
"mode": "auto",
@Enmk
Enmk / instagram_votes_count.js
Created May 5, 2018 09:41
Instagram Vote Count
var comments = document.getElementsByClassName("_ezgzd");
let op = "";
var total_votes = {'1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0};
for (let i = 0; i < comments.length; ++i) {
let c = comments[i]
if (c.textContent.length > 500 || c.firstChild.textContent == op)
continue;
let votes = c.children[1].textContent;
votes = votes.replace(/[^\d]/g, '');