Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Pastuhov Kirill pastuhov

💭
I may be slow to respond.
View GitHub Profile
View base
{
"id": "base",
"properties": {
"prop1": {
"type": "number"
},
"prop2": {
"type": "number"
},
"prop_obj": {
@pastuhov
pastuhov / Dockerfile
Created June 24, 2022 06:07
Dockerized python app with latest librdkafka lib
View Dockerfile
FROM gcc:bullseye AS builder
WORKDIR /root
RUN git clone https://github.com/edenhill/librdkafka.git
WORKDIR /root/librdkafka
RUN /root/librdkafka/configure --prefix=/root/librdkafka
RUN make
RUN make install
FROM python:3.10.5-bullseye
@pastuhov
pastuhov / docker-compose.yml
Created February 2, 2022 05:45
kafka + schema-registry + akhq
View docker-compose.yml
version: '3.6'
volumes:
zookeeper-data-0:
driver: local
zookeeper-log-0:
driver: local
kafka-data-0:
driver: local
services:
akhq:
@pastuhov
pastuhov / python_m1.sh
Created September 28, 2021 13:58
Python on apple silicon m1
View python_m1.sh
#!/usr/bin/env zsh
mdir=${0:a:h}
/usr/bin/arch -x86_64 $mdir/python "$@"
@pastuhov
pastuhov / query.sql
Created June 8, 2021 05:58
Sentry db query - issues
View query.sql
SET TIME ZONE 5;
SELECT
error_count,
date_added,
error_count - lag(error_count, 1)
OVER () delta,
avg(error_count)
OVER () average_count,
CASE WHEN error_count > avg(error_count) OVER ()
@pastuhov
pastuhov / query.sql
Created June 8, 2021 05:53
jira db query - completed tasks & story points
View query.sql
SELECT count(t.ID) AS "completed tasks",
CAST(sum(c.NUMBERVALUE) AS unsigned integer) AS "story points",
coalesce(user.display_name, ASSIGNEE) AS display_name,
ASSIGNEE AS jiraname
FROM jira.jiraissue t
JOIN customfieldvalue AS c ON c.ISSUE = t.ID
AND c.CUSTOMFIELD = 10008
JOIN customfieldvalue AS s ON s.ISSUE = t.ID
AND s.CUSTOMFIELD = 10000
JOIN ao_60db71_sprint AS sprint ON sprint.ID = s.STRINGVALUE
@pastuhov
pastuhov / bash
Last active July 16, 2020 08:29
OCR last screenshot and copy on mac
View bash
ss=$(ls -t ~/Desktop/*.* | head -n1) && tesseract $ss stdout |tr -d \\f|pbcopy
@pastuhov
pastuhov / index.js
Created February 15, 2020 05:42
modify xhr response
View index.js
const chromeLauncher = require('chrome-launcher');
const CDP = require('chrome-remote-interface');
const atob = require('atob');
const btoa = require('btoa');
async function main() {
const chrome = await chromeLauncher.launch({
chromeFlags: [
'--window-size=1200,800',
'--user-data-dir=/tmp/chrome-testing',
@pastuhov
pastuhov / AcceptanceHelper.php
Last active December 27, 2021 21:42
codeception page load wait helper
View AcceptanceHelper.php
<?php
namespace tests\codeception\common\_support;
use Codeception\Exception\ModuleException;
/**
*
*/
class AcceptanceHelper extends \Codeception\Module
View docker jscoverage
# JSCoverage
RUN cd /root/ \
&& wget http://siliconforks.com/jscoverage/download/jscoverage-0.5.1.tar.bz2 \
&& tar jxvf jscoverage-0.5.1.tar.bz2 \
&& cd jscoverage-0.5.1/ \
&& ./configure \
&& make \
&& make install