Skip to content

Instantly share code, notes, and snippets.

View BedirYilmaz's full-sized avatar
🤖
Building

Bedir Yılmaz BedirYilmaz

🤖
Building
View GitHub Profile
@BedirYilmaz
BedirYilmaz / move_from_subdirs_to_current.sh
Created December 25, 2018 03:45
Move all files in subdirectories to current directory
# https://superuser.com/questions/355891/move-all-files-from-subdirectories-to-current-directory
find . -type f -mindepth 2 -exec mv -i -- {} . \;
@BedirYilmaz
BedirYilmaz / kill_process_by_port.sh
Last active October 3, 2018 03:53
Kill the process that runs at the port 8888 (linux)
# https://stackoverflow.com/a/11596144/776348
fuser -k 8888/tcp
@BedirYilmaz
BedirYilmaz / create_dir.py
Created September 27, 2018 02:37
create dirs the safe way in python
def create_dir(path):
if not os.path.isdir(path):
os.makedirs(path)
@BedirYilmaz
BedirYilmaz / rename_prefix.sh
Created August 13, 2018 08:44
Change prefix from "IMG_" to "GT_IMG_"
rename 's/^IMG_/GT_IMG_/' *
########## Assignment 2-3 Closest person to each person in each image
########## - Calculate the Euclidean Distance between every pair in every annotation
########## - Match everyone with their closet
########## 10/04/2018
########## Nithikan Srinakrung - Bam
########## DF4, FTSM, UKM
import os,sys
@BedirYilmaz
BedirYilmaz / renamer.py
Created December 14, 2017 00:34
Py script that renames a file to names of its parent folders : to be used with find_rename_and_copy.sh
#!/usr/bin/env python3
import shutil
import sys
import string
pathStr = sys.argv[1]
splittedPath = string.split(pathStr, '/')
upper = splittedPath[-3]
upper_2 = splittedPath[-5]
@BedirYilmaz
BedirYilmaz / find_rename_and_copy.sh
Created December 14, 2017 00:31
My First bash script ever : finds all mp4 s in a folder and its subfolders, then applies a pyhton script on them
#!/bin/bash
for name in `find . -type f -name "*.mp4"`
do
python renamer.py ${name}
done
@BedirYilmaz
BedirYilmaz / soyisimler.sql
Last active October 14, 2025 15:27
Türkçe Soyisim Listesi - Sqlleştirildi
CREATE TABLE soyisimler (
id int IDENTITY(1,1) NOT NULL,
soyisim varchar(255) NOT NULL,
PRIMARY KEY (id)
)
INSERT INTO soyisimler VALUES ('ABAT');
INSERT INTO soyisimler VALUES ('ABSEYİ');
INSERT INTO soyisimler VALUES ('ABACIOĞLU');
INSERT INTO soyisimler VALUES ('ACAR');
@BedirYilmaz
BedirYilmaz / mouser.py
Created June 15, 2017 13:31
Open your Paint at fullscreen and let your code draw nested circles with your mouse.
import win32api, win32con
import math
widest = 1000
narrowest = 100
step = 100
num_of_points = 100
def click(x, y):
#https://stackoverflow.com/questions/1181464/controlling-mouse-with-python
@BedirYilmaz
BedirYilmaz / turkce_soyisimler.sql
Created April 26, 2017 12:58
https://gist.github.com/emrekgn/493304c6445de15657b2 adresindeki verinin içinden mükerrerleri alınmış ve sql server syntaxına göre insert sorgusuna dönüştürülmüş hali.
CREATE TABLE soyisimler (
id int IDENTITY(1,1) NOT NULL,
soyisim varchar(255) NOT NULL,
PRIMARY KEY (id)
)
INSERT INTO soyisimler VALUES ('ABAT');
INSERT INTO soyisimler VALUES ('ABSEYİ');
INSERT INTO soyisimler VALUES ('ABACIOĞLU');
INSERT INTO soyisimler VALUES ('ACAR');