Skip to content

Instantly share code, notes, and snippets.

View cyb3rsalih's full-sized avatar

mehmet salih bindak cyb3rsalih

View GitHub Profile
@cyb3rsalih
cyb3rsalih / split_xlsx.py
Created July 23, 2024 14:05
Split excel file with headers
import pandas as pd
# Function to split the DataFrame into smaller DataFrames
def split_dataframe(df, chunk_size):
return [df[i : i + chunk_size] for i in range(0, df.shape[0], chunk_size)]
# Read the Excel file
input_file = "input.xlsx"
@cyb3rsalih
cyb3rsalih / split_vcard.py
Created May 25, 2024 09:36
Split vcard files
def split_vcard(file_path, records_per_file):
# vCard dosyasını oku
with open(file_path, "r", encoding="utf-8") as file:
vcard_data = file.read()
# vCard'ları ayır
vcards = vcard_data.split("END:VCARD")
# 'END:VCARD' satırını geri ekle
vcards = [vcard + "END:VCARD" for vcard in vcards if vcard.strip()]
@cyb3rsalih
cyb3rsalih / csv_to_xlsx.py
Created April 15, 2024 06:27
Turn CSV into XLSX
import pandas as pd
# CSV dosyasını oku
df = pd.read_csv("in.csv")
# DataFrame'i XLSX formatında kaydet
df.to_excel("out.xlsx", index=False)
@cyb3rsalih
cyb3rsalih / gazete.py
Last active December 30, 2023 15:23
Find Turkish Newspaper for a Date;
# Example usage python3 gazete.py "23 Mayıs 1954"
import concurrent.futures
import sys
import requests
gazeteler = [
"agac",
"ahali_filibe",
@cyb3rsalih
cyb3rsalih / notify_me.py
Created April 29, 2023 15:16
notify when site changed
import requests
import time
import argparse
parser = argparse.ArgumentParser(description='Site kontrol uygulaması')
parser.add_argument('--url', required=True, type=str, help='Kontrol edilecek URL')
parser.add_argument('--interval', required=True, type=int, help='Kontrol aralığı (dakika cinsinden)')
parser.add_argument('--notify', required=True, type=str, help='Bildirim yapılacak URL')
parser.add_argument('--post', type=str, help='POST isteği yapılacak veri')
@cyb3rsalih
cyb3rsalih / split_txt_file.py
Last active February 28, 2023 12:01
Large file splitter
import sys
if len(sys.argv) != 3:
print("Usage: python script.py BUYUK_DOSYA_ADI SATIR_SAYISI_LIMITI")
sys.exit(1)
# Komut satırı argümanlarını al
buyuk_dosya_adi = sys.argv[1]
satir_sayisi_limiti = int(sys.argv[2])
@cyb3rsalih
cyb3rsalih / mac_address_changer.sh
Last active February 27, 2023 13:16
MAC address Changer for MacOS
#!/bin/bash
# Show the list of network interfaces
echo "Available network interfaces:"
networksetup -listallhardwareports | grep "Hardware Port"
# Prompt the user to enter the interface number
echo "Enter the number of the interface you want to change (e.g., 1 for en0): "
read interface_num
@cyb3rsalih
cyb3rsalih / remove_html_elements.py
Created January 9, 2023 08:03
Remove HTML elements from a file
import re
mext = ''
with open('html.txt', 'r') as f:
text = f.read()
mext = re.sub('<[^<]+?>', '', text)
with open('without_html.txt', 'w') as x:
@cyb3rsalih
cyb3rsalih / main.go
Created November 14, 2022 09:31
Go File and Folder Creating
// mkdir program && cd program
// touch main.go
// paste code to main.go
// go build
// ./program
package main
import (
@cyb3rsalih
cyb3rsalih / modal_bottom_sheet.dart
Created October 3, 2022 11:29
Modal Bottom Sheet
awesomeWidget(BuildContext context) {
var verticalGestures = Factory<VerticalDragGestureRecognizer>(() => VerticalDragGestureRecognizer());
var gestureSet = {verticalGestures};
final Completer<WebViewController> _controller = Completer<WebViewController>();
Future<void> _loadHtmlString(Completer<WebViewController> controller, BuildContext context) async {
WebViewController _controller = await controller.future;
await _controller.loadHtmlString(webview_content);
}