Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mesutpiskin's full-sized avatar
👀
I may be slow to respond.

Mesut Pişkin mesutpiskin

👀
I may be slow to respond.
View GitHub Profile
apiVersion: v1
stringData:
KEYCLOAK_ROOT_USER: admin
KEYCLOAK_ROOT_PASSWORD: Password@1
KEYCLOAK_DB_USER: sa
KEYCLOAK_DB_PASSWORD: Password@1
kind: Secret
metadata:
name: keycloak-mssql
type: Opaque
class ProductPurchasingStepDefinitions {
@Given("{string} kodlu kullanıcı oturum açmalıdır")
public void kullaniciOturumAcmalidir(String p1) {
User user = new User();
user.code = p1;
user.password = "****";
RestUtils.Post("http://localhost:8080/userservice/user/login", user);
}
Feature: Kullanıcılar e-tiracret platformu üzerinden seçtikleri ürünü satın alabilir.
Scenario: (Success) Satın alınan ürününün stok miktarı, satın alınan adet kadar azalalır.
Given "USER1" kodlu kullanıcı oturum açmalıdır
And "PRODUCT1" kodlu ürünün stok miktarı 100 olarak güncellenir
And "USER1" kodlu kullanıcının sepeti temizlenir
And "PRODUCT1" kodlu üründen sepete 1 adet eklenir
When "USER1" kodlu kullanıcı ödeme işlemi gerçekleştirildiğinde
@mesutpiskin
mesutpiskin / redis-search-and-delete.go
Last active December 2, 2022 07:09
Redis Delete Keys Matching a Search Pattern with Go Lang. Redis client https://github.com/go-redis/redis
package main
import (
"context"
"fmt"
"os"
"github.com/go-redis/redis/v8"
)
apiVersion: v1
kind: Pod
metadata:
name: bulkhead-myapp
spec:
containers:
- name: bulkhead-myapp-container
image: bulkhead-myapp
resources:
requests:
@mesutpiskin
mesutpiskin / FakeAsyncCursor.cs
Last active October 21, 2019 08:29
fake/dummy implementation of mongodb IAsyncCursor used for testing
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MongoDB.Driver;
namespace MyProject.Test
{
public class DummyAsyncCursor<TEntity> : IAsyncCursor<TEntity>
{
@mesutpiskin
mesutpiskin / image_data_generator.py
Last active April 11, 2019 13:24
Image data generator with Keras
import os
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
from PIL import Image
import glob
image_count = 5
current_dataset_folder = "train/*.*"
export_folder_name = "newdataset"
@mesutpiskin
mesutpiskin / MeanShift.py
Last active May 13, 2020 10:00
Ağırlıklı Ortalama Öteleme Algoritması (Mean Shift) ile Hareketli Nesne Takibi #OpenCV #Python
# http://mesutpiskin.com/blog/agirlikli-ortalama-oteleme-algoritmasi-mean-shift-ile-hareketli-nesne-takibi.html
# https://youtu.be/9qzaBzmmL7s
import cv2
import numpy as np
videoCapture = cv2.VideoCapture("video.mp4")
@mesutpiskin
mesutpiskin / calibration_fisheye2.py
Created June 23, 2018 10:24
OpenCV fisheye calibration and undistortion
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 17 19:59:33 2018
@author: mesut
"""
import yaml
import cv2
assert cv2.__version__[0] == '3', 'The fisheye module requires opencv version >= 3.0.0'
import numpy as np
@mesutpiskin
mesutpiskin / calibration.py
Last active March 29, 2024 06:40
Fisheye Camera Calibration with OpenCV
import numpy as np
import cv2
import glob
# Define the chess board rows and columns
CHECKERBOARD = (6,9)
subpix_criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.1)
calibration_flags = cv2.fisheye.CALIB_RECOMPUTE_EXTRINSIC + cv2.fisheye.CALIB_CHECK_COND + cv2.fisheye.CALIB_FIX_SKEW
objp = np.zeros((1, CHECKERBOARD[0]*CHECKERBOARD[1], 3), np.float32)
objp[0,:,:2] = np.mgrid[0:CHECKERBOARD[0], 0:CHECKERBOARD[1]].T.reshape(-1, 2)