Skip to content

Instantly share code, notes, and snippets.

View suatatan's full-sized avatar
:octocat:
Creating something new

Suat ATAN (PhD) suatatan

:octocat:
Creating something new
View GitHub Profile
@suatatan
suatatan / resimlerle_kuran_privacy_policy.md
Created February 24, 2026 10:51
ResimlerleKuran App Privacy Policy

Privacy Policy

Effective Date: 24 February 2026

Resimlerle Kuran ("we", "our", "us") respects your privacy. This Privacy Policy explains how the app handles information.

1. Information We Collect

We do not collect, store, or share any personal data.

2. Data Usage

@suatatan
suatatan / langflow_collector.py
Created November 24, 2025 13:23
# Langflow Language Model Result Collector Component: It is very weird but Langflow does not have loop component adaptable component for iterative process in the chunk-by-chunk approaches. I created one. You can copy and paste after clicking "new component" in Langflow.
import os
from langflow.custom import Component
from langflow.io import MessageInput, Output, MessageTextInput
from langflow.schema import Data, Message
class AppendMessageToData(Component):
display_name = "Append Message & Convert to Data"
description = "Takes Message (Blue), appends to file, and converts to Data (Red) for Loop compatibility."
icon = "save"
name = "AppendMessageToData"
@suatatan
suatatan / Adding User to DB.sql
Created January 29, 2025 07:42
Adding User to DB and verifying
-- CREATE USER SuatATAN with PASSWORD ='PASSWORD'
-- ALTER ROLE db_datareader ADD MEMBER SuatATAN
SELECT
dp.name AS UserName,
dp.type_desc AS UserType,
STRING_AGG(rp.name, ', ') AS AssignedRoles
FROM sys.database_principals dp
LEFT JOIN sys.database_role_members drm ON dp.principal_id = drm.member_principal_id
LEFT JOIN sys.database_principals rp ON drm.role_principal_id = rp.principal_id
import cv2
import os
def shrink_video(input_path, output_path, scale_percent):
"""
Shrinks a video by a given scale percentage using OpenCV.
Args:
input_path (str): Path to the input video file.
@suatatan
suatatan / vekaletname.md
Last active August 22, 2023 08:40
Genel Vekaletname

"Sahibi ve hissedarı bulunduğumuz {Türkiye Cumhuriyeti Hudutları Dahilinde Bulunan Bilumum} taşınmazdaki/taşınmazlardaki hak ve hisselerimizin tamamını veya bir kısmını dilediği bedel ve koşullarla toptan veya parça parça, hisseli veya hissesiz, ipotekli veya ipoteksiz olarak dilediği gerçek veya tüzel kişilere satmaya, satış bedellerini almaya, Taşınmaz Satış Sözleşmelerini noterliklerde veya ilgili Tapu Sicil Müdürlüklerinde imzalamaya, ahzu kabza, sulh ve ibraya, ilgili tapu sicil müdürü, noter veya yetkili tapu memuru huzurunda kesin ferağ takrirlerini vermeye, tescil talebinde bulunmaya, tapu defteri ve sicilini ve belgelerini imzalamaya,dilerse noter huzurunda kesin ferağ takrirlerini vermeye, dilediği şekil ve şartlarda taşınmaz satış sözleşmesini, gerekli beyan, taahhüt ve diğer tüm belgeleri noterliklerde tanzim ve imzalamaya, taşınmaz satışıyla ilgili izin, muvafakat gerekli bütün belgeleri ilgili kurum ve kuruluşlardan almaya, tescil talebinde bulunmaya, gerekirse tapu harcını, tapu döner sermay

class WordCluster:
def __init__(self, list_of_strings, threshold_for_clustering):
"""
@param list_of_strings ['str1','str2']
@param threshold_for_clustering: number of sequence in string 3-4 is best
"""
self.list_of_strings = list_of_strings
self.threshold_for_clustering = threshold_for_clustering
self.cluster_categories = None # will be calculated
@suatatan
suatatan / elgrapho-random-radial-tree.markdown
Created May 12, 2022 19:42
ElGrapho Random Radial Tree
@suatatan
suatatan / gelen_sonuc.json
Created May 1, 2022 10:26
ElasticSearch MultiSearch API yani birden fazla sorguyu tek seferde gönderip sonuç alma
{
"took": 4,
"responses": [
{
"took": 4,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
@suatatan
suatatan / sql_tablolar_ayni_mi.sql
Last active March 9, 2022 15:32
SQL'de farklı yerlerde ancak aynı iki tablonun içeriğinin aynı olup olmadığın kontrol etmek
--CHECKSUM yöntemi
--Eğer ki iki tablomuz sırf aynı mı değil mi diye bakıyorsak ve farklı çıktığında hangi kayıtların farklı olduğunun önemi yoksa
CHECKSUM TABLE original_table, backup_table;
--Bu sorgu iki tabloda Primary Key olmasını gerektirmez veriye bakar
--EXCEPT Yöntemi
--Eğer iki tablomuz aynı mı değil mi diye bakarken farklı olanları görmek istiyorsak şu sorguyu çalıştırız.
--Eğer sonuç boş gelirse iki tablo aynıdır.
--Dolu gelirse farkları görürüz.
@suatatan
suatatan / slow.sql
Created February 25, 2022 06:44
Find the slowest queries in MSSQL
select top 20 dest.text, deqs.execution_count, deqs.total_elapsed_time, deqs.total_worker_time,
(deqs.total_elapsed_time / deqs.execution_count) as 'avg_elapse_time',
(deqs.total_worker_time / deqs.execution_count) as 'avg_worker_time'
from sys.dm_exec_query_stats as deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) as dest
where deqs. last_execution_time >= '2021-09-27 16:00' /* YOUR DATE AND TIME HERE*/
order by 'avg_elapse_time' desc