Skip to content

Instantly share code, notes, and snippets.

View yusufdemyr's full-sized avatar

Yusuf Demir yusufdemyr

View GitHub Profile
@yusufdemyr
yusufdemyr / turkiye_bolge_il.py
Created October 28, 2023 12:05
Türkiye Bölge ve il (şehir) sözlüğü (dictionary for python)
# Şehire göre bölge bilgisi
sehir_bolge = {
'Akdeniz Bölgesi': ['Adana', 'Antalya', 'Burdur', 'Hatay', 'Isparta', 'Mersin', 'Osmaniye'],
'Doğu Anadolu Bölgesi': ['Ağrı', 'Ardahan', 'Bingöl', 'Bitlis', 'Elazığ', 'Erzincan', 'Erzurum', 'Hakkari', 'Iğdır', 'Kars', 'Malatya', 'Muş', 'Tunceli', 'Van'],
'Ege Bölgesi': ['Afyonkarahisar', 'Aydın', 'Denizli', 'İzmir', 'Kütahya', 'Manisa', 'Muğla', 'Uşak'],
'Güneydoğu Anadolu Bölgesi': ['Adıyaman', 'Batman', 'Diyarbakır', 'Gaziantep', 'Mardin', 'Kilis', 'Siirt', 'Şanlıurfa', 'Şırnak'],
@yusufdemyr
yusufdemyr / downloadFiles.js
Last active October 14, 2023 10:14
Automating Download of PDF and PPTX Files from Web Page.
// Collect all links
var links = document.getElementsByTagName("a");
// Function to initiate the download process
function startDownload(index) {
if (index < links.length) {
var link = links[index].getAttribute("href");
if (link.endsWith(".pdf") || link.endsWith(".pptx")) {
var fileName = link.substring(link.lastIndexOf("/") + 1);
downloadFile(link, fileName, function () {
@yusufdemyr
yusufdemyr / program.cs
Created March 4, 2023 15:54
Simple Math Game with C#
/*
This C# console application requires the user to solve a simple math question involving multiplying and subtracting a number,
and provides the correct answer.
The program allows the user to solve the question by generating random numbers, and provides the correct answer.
*/
using System;
namespace Variables
{
@yusufdemyr
yusufdemyr / program.cs
Created March 4, 2023 15:03
C# Console Application for Logging User Input
/*
This is a simple C# console application that prompts the user to enter a message, logs the user input to a text file,
and writes a timestamp for each log entry. The application uses a LogWriter class to handle writing to the log file.
The log file is created in the same directory as the application executable.
If an error occurs while writing to the log file, the application prints an error message to the console.
*/
using System;
using System.IO;
using System.Reflection;