Skip to content

Instantly share code, notes, and snippets.

View BedirYilmaz's full-sized avatar
🌍

Bedir Yılmaz BedirYilmaz

🌍
View GitHub Profile
@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 February 10, 2022 19:35 — forked from emrekgn/soyisimler
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');
@BedirYilmaz
BedirYilmaz / Soru13.py
Created October 26, 2016 08:22
Find the first ten digits of sum of this numbers
nums = [];
nums.append (37107287533902102798797998220837590246510135740250)
nums.append (46376937677490009712648124896970078050417018260538)
nums.append (74324986199524741059474233309513058123726617309629)
nums.append (91942213363574161572522430563301811072406154908250)
nums.append (23067588207539346171171980310421047513778063246676)
nums.append (89261670696623633820136378418383684178734361726757)
nums.append (28112879812849979408065481931592621691275889832738)
nums.append (44274228917432520321923589422876796487670272189318)