Skip to content

Instantly share code, notes, and snippets.

View techkuz's full-sized avatar
🎯
Focusing

Kuz Le techkuz

🎯
Focusing
View GitHub Profile
@techkuz
techkuz / HW1.sql
Created January 26, 2022 17:44
ZOOM-CAMP 1
3
SELECT COUNT(*)
FROM yellowtripdata
WHERE tpep_pickup_datetime::date = '2021-01-15';
4
SELECT MAX(tip_amount), tpep_pickup_datetime::date
FROM public.yellowtripdata
WHERE EXTRACT(MONTH FROM tpep_pickup_datetime) = 1
GROUP BY tpep_pickup_datetime::date
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 February 20, 2020 11:06
Python find print/ найти принт
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 December 24, 2019 08:49 — forked from miguelmota/Dockerfile
Dockerfile grpcurl binary download
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 October 24, 2019 06:13
Insert without extra indents vim

Esc, :set paste
Paste
Esc, :wq

@techkuz
techkuz / kafkazookeeper.yaml
Created September 30, 2019 08:44
kafka zookeeper docker compose
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 September 17, 2019 13:32
Update clickhouse column value
ALTER TABLE TableName UPDATE ColumnName = ValueOne WHERE AnotherColumn = ValueTwo
@techkuz
techkuz / example_req.py
Created July 2, 2019 09:14
Send request to azure inkrecognizer
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 17:34
Install pyenv Ubuntu 16.04 quick
curl https://pyenv.run | bash
@techkuz
techkuz / dolya.txt
Created May 12, 2019 09:01
Как посчитать долю
Количество данных по выборке разделить на количество данных всего