Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Kuz Le techkuz

🎯
Focusing
View GitHub Profile
View partial_example.py
from functools import partial
def test(a, b, c):
print(a)
print(b)
print(c)
foo = partial(test, b=6, c=7)
@techkuz
techkuz / ex_exc.py
Created Feb 20, 2020
Python find print/ найти принт
View ex_exc.py
import sys
import traceback
class TracePrints(object):
def __init__(self):
self.stdout = sys.stdout
def write(self, s):
self.stdout.write("Writing %r\n" % s)
traceback.print_stack(file=self.stdout)
@techkuz
techkuz / Dockerfile
Created Dec 24, 2019 — forked from miguelmota/Dockerfile
Dockerfile grpcurl binary download
View Dockerfile
FROM ubuntu:18.04
RUN apt-get update -y
RUN apt-get install wget -y
RUN wget https://github.com/fullstorydev/grpcurl/releases/download/v1.1.0/grpcurl_1.1.0_linux_x86_64.tar.gz
RUN tar -xvzf grpcurl_1.1.0_linux_x86_64.tar.gz
RUN chmod +x grpcurl
RUN mv grpcurl /usr/local/bin/grpcurl
@techkuz
techkuz / readme.md
Created Oct 24, 2019
Insert without extra indents vim
View readme.md

Esc, :set paste
Paste
Esc, :wq

@techkuz
techkuz / kafkazookeeper.yaml
Created Sep 30, 2019
kafka zookeeper docker compose
View kafkazookeeper.yaml
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:5.3.1
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ZOOKEEPER_SYNC_LIMIT: 2
ports:
- 2181:2181
@techkuz
techkuz / upd.sql
Created Sep 17, 2019
Update clickhouse column value
View upd.sql
ALTER TABLE TableName UPDATE ColumnName = ValueOne WHERE AnotherColumn = ValueTwo
@techkuz
techkuz / example_req.py
Created Jul 2, 2019
Send request to azure inkrecognizer
View example_req.py
import requests, json
subs_key = API_KEY
uri_base = 'https://api.cognitive.microsoft.com/inkrecognizer/v1.0-preview/recognize'
headers = {'Content-type': 'application/json',
"Ocp-Apim-Subscription-Key": subs_key}
body = {}
@techkuz
techkuz / code.txt
Created May 21, 2019
Install pyenv Ubuntu 16.04 quick
View code.txt
curl https://pyenv.run | bash
@techkuz
techkuz / dolya.txt
Created May 12, 2019
Как посчитать долю
View dolya.txt
Количество данных по выборке разделить на количество данных всего
View clickhouse-get-tables-size.sql
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table