Skip to content

Instantly share code, notes, and snippets.

@melihme
melihme / deprem.py
Created April 5, 2023 12:54
Kandilli Deprem Verisi İndirme
import os
import multiprocessing
from time import sleep
import requests
download_path = "./data5"
start_year = 2013
end_year = 2023 # partial data will occur if the year has not yet ends
@melihme
melihme / soft_light_blend.py
Created November 7, 2015 01:13
Photoshop soft light blend with Numpy
import numpy as np
#https://en.wikipedia.org/wiki/Blend_modes#Soft_Light
def soft_light_blend(im1, im2):
nrm_im1 = im1/255.
nrm_im2 = im2/255.
res = np.zeros_like(nrm_im1)
xif = nrm_im2 < .5
xel = nrm_im2 >= .5
@melihme
melihme / gist:6ec023705d0afc213019
Last active June 16, 2022 10:49
Vergi Kimlik No. Doğrulama (Python)
def taxnum_checker(t):
if len(t) != 10:
return False
total = 0
for x in xrange(0, 9):
tmp1 = (int(t[x]) + (9 - x)) % 10
tmp2 = (tmp1 * (2 ** (9 - x))) % 9
if tmp1 != 0 and tmp2 == 0:
tmp2 = 9