Skip to content

Instantly share code, notes, and snippets.

View maxkarelov's full-sized avatar
🏠
Working from home

Max Karelov maxkarelov

🏠
Working from home
View GitHub Profile
@maxkarelov
maxkarelov / measure_img_similarity.py
Created March 20, 2019 00:17 — forked from duhaime/measure_img_similarity.py
Compare image similarity in Python using Structural Similarity, Pixel Comparisons, Wasserstein Distance (Earth Mover's Distance), and SIFT
import warnings
from skimage.measure import compare_ssim
from skimage.transform import resize
from scipy.stats import wasserstein_distance
from scipy.misc import imsave
from scipy.ndimage import imread
import numpy as np
import cv2
##
curl http://api.ofdx.ru/v1/items?fn=123&fpd=123&fd=123
@maxkarelov
maxkarelov / haproxy.conf
Created August 10, 2018 10:08 — forked from thpham/haproxy.conf
test config haproxy for gRPC loadbalancing
global
tune.ssl.default-dh-param 1024
defaults
timeout connect 10000ms
timeout client 60000ms
timeout server 60000ms
frontend fe_http
mode http
@maxkarelov
maxkarelov / qr_decode.py
Created May 25, 2017 13:41
decode qr code from photo sample script
from PIL import Image
import zbarlight
file_path = '/Users/ivankumar/Downloads/sample3.jpg'
with open(file_path, 'rb') as image_file:
image = Image.open(image_file)
image.load()
codes = zbarlight.scan_codes('qrcode', image)
print('QR codes: %s' % codes)
@maxkarelov
maxkarelov / gist:b3a799bddcf30dfac45908dfa6f927b3
Created October 19, 2016 18:19
marathon application requests for seed and regular nodes
# SEED NODE
{
"id": "/mycoolenv/cassandra-seed",
"cmd": "chown -R cassandra /var/lib/cassandra && start $SEED",
"cpus": 0.5,
"mem": 400,
"disk": 0,
"instances": 1,
"constraints": [
[
def com(A, B):
result = [[[] for j in range(0, 4)] for i in range(0, 4)]
for i in range(0, 4):
T = []
for j in range(0, 4):
for k in range(0, 4):
result[i][j].append(min(A[i][k], B[k][j]))
return result
@maxkarelov
maxkarelov / getlink.sh
Last active February 10, 2016 16:33
quick download artifact from nexus
@maxkarelov
maxkarelov / gist:0417e9804dd70d72dfda
Created January 21, 2016 10:31
sonarqube jdbc url
SONARQUBE_JDBC_URL=jdbc:mysql://db:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&maxAllowedPacket=2145638
@maxkarelov
maxkarelov / masm_task6.asm
Created January 17, 2016 17:09
masm task6, mdlp
; ВАРИАНТ №252
; F = 0x2569 + (0x12 + x - y)
; Макрос выделяет место в стеке под 4 обязательных
; аргумента функций, а также, если необходимо,
; под дополнительные
STACKALLOC macro argc
; Запоминаем указатель на изначальный стек
push r15
mov r15, rsp
project = SP and reporter IN (admin, admin2) AND summary ~ task AND description ~ text AND status = "to do"