Skip to content

Instantly share code, notes, and snippets.

View molcay's full-sized avatar
:octocat:

M. Olcay Tercanlı molcay

:octocat:
View GitHub Profile
liste = ["belgeler.yazbel.com/"]
liste1 = ["elma/", "armut/", "erik/"]
liste3 = ["deneme"]
liste4 = []
for i in liste:
for j in liste1:
for k in liste3:
liste4.append(i+j+k)
  • Clone the repo
git clone REPO_URL
  • change directory
cd REPO_NAME
rows = """0,1,2,3,4,5,6,7,8,9
3,4,5,6
0,9,8,7,6,5
""".strip().split("\n")
for row in rows: # veritabanın gelen satırlar row olarak döngü içinde kullanılacak
splitted_val = row.split(",")
for value in splitted_val:
print(value)
@molcay
molcay / file1.txt
Created July 23, 2018 10:07
the description for this gist
String file contents
from bs4 import BeautifulSoup
from datetime import datetime, timedelta
import requests
datexxx = []
soup = BeautifulSoup(requests.get('https://hltv.org/results').content, 'lxml')
now = datetime.now()
month = datetime.strftime(now, '%b')
# Yardımcı fonksiyonlar
def harf_notu_hesapla(sonuc): # ögrencinin ortalamasından harf notunu hesaplayan fonksiyon
if sonuc >= 90:
harf = "AA"
elif sonuc >= 85:
harf = "BA"
elif sonuc >= 80:
harf = "BB"
elif sonuc >= 75:
harf = "CB"
#!/bin/bash
for kelime in $(cat "test.txt")
do
desen="[0-9]+"
# echo $kelime
if [[ $kelime =~ $desen ]]
then
echo $kelime
fi
@molcay
molcay / row2col.py
Created November 3, 2017 13:53
satır halinde ki mail adreslerini alt alta yazmak için script
import os
input_file = "mail.txt"
output_file = "cikti.txt"
with open(input_file, 'r') as dosya: # with open() yapısı seni ayrı ayrı .open() .close() yapmaktan kurtarır, kendisi kapatır.
oku = dosya.read()
oku = oku.strip() # eğer satır sonunda gereksiz boşluk yada yeni satır karateri varsa onu temizler.
mail_adresleri = oku.split(" ")
{
"movies": [
{
"rating": "8.7",
"genres": [
"Crime",
"Drama"
],
"countries": [
"Brazil",
@molcay
molcay / R.md
Last active March 29, 2017 19:05
Çalışma Notları (İstatistiksel Hesaplamalar için R)

Çalışma Notları (İstatistiksel Hesaplamalar için R)

  • Değişken atama ve matematiksel hesaplamalar:
> hours <- 12
> days <- 2.5
> total.hours <- hours * days
> total.hours
[1] 30