Skip to content

Instantly share code, notes, and snippets.

@byigitt
byigitt / react-effects.mdc
Last active September 22, 2025 10:03
"You Might Not Need an Effect" article from React.dev - cursorrule version
---
description: Prefer render-time derivations, event handlers, keys, and external-store subscriptions over useEffect. Only use Effects to sync with external systems. Include refactor suggestions.
globs:
---
# React “You Might Not Need an Effect” — Project Rule
## Golden Rule
Before writing or keeping a `useEffect`, ask: **Is there an external system that must be synchronized (DOM outside React, timers, subscriptions, storage, network, non-React widget)?**
- **If NO** → remove/avoid the Effect and prefer render-time code or event handlers.
@byigitt
byigitt / homework.rs
Created June 4, 2025 16:03
rust basic homework
struct Customer {
name: String,
surname: String,
balance: f64,
}
struct Product {
name: String,
price: f64,
stock: u32,
@byigitt
byigitt / most-used.json
Created May 22, 2025 05:55
yazılımcıların bolca kullandığı kelime sözlüğü, jsonized
[
{"word":"hotfix","meaning":"Acil çözülmesi gereken kritik bir hata için yapılan hızlı müdahale.","example":"Canlıya çıkan bug için gece 2'de hotfix geçtik."},
{"word":"refactor","meaning":"Yazılımın davranışını değiştirmeden kod yapısını iyileştirmek.","example":"Bu fonksiyon çok karışık olmuş, biraz refactor edelim."},
{"word":"commit","meaning":"Yaptığınız kod değişikliklerini versiyon kontrol sistemine kaydetmek.","example":"Özellik tamamlandı, commit mesajımı yazıp push’ladım."},
{"word":"push","meaning":"Yerel depo üzerindeki commitleri uzak repoya göndermek.","example":"Yeni branch’imi oluşturup kodu remote’a push ettim."},
{"word":"pull","meaning":"Uzak repodaki güncellemeleri yerel depoya indirmek.","example":"Önce master’dan pull al, sonra merge et."},
{"word":"merge","meaning":"İki farklı dalı birleştirerek değişiklikleri entegre etmek.","example":"Feature branch’i develop ile merge ettim."},
{"word":"branch","meaning":"Versiyon kontrolünde bağımsız bir çalışma hattı oluşturmak.","ex
@byigitt
byigitt / hi.js
Created May 12, 2025 15:29
poke-battle
function nope() {
let links = document.getElementsByTagName("span");
for (var i = 0 ; i != links.length; i++) {
let link = links[i];
if (link.innerHTML.includes("Geri Dürt")) link.click();
}
}
setInterval(() => nope(), 3000);
@byigitt
byigitt / tips.md
Created January 21, 2025 12:23
tips for interviews, noted for myself for later

If input array is sorted then

  • Binary search
  • Two pointers

If asked for all permutations/subsets then

  • Backtracking

If given a tree then

  • DFS
  • BFS
@byigitt
byigitt / instruction.md
Last active December 28, 2024 15:30
Prompt for create project step-by-step guide instructions with markdown
### 🚀 Project Insights and Step-by-Step Guide Prompt 🚀

**Role:** You are an advanced AI assistant with expertise in project planning, software architecture, UI/UX design principles, and professional documentation. Your task is to deliver a comprehensive project overview, clear and actionable step-by-step instructions, and insights into best practices—all WITHOUT using any code blocks.

**Important Notes:** 
- Replace all ` with \` and all ``` with \`\`\` in your response to prevent formatting issues in code blocks.
- Save the generated instructions into an `instructions.md` file for easy access and collaboration.
- Use shadcn@latest instead of shadcn-ui@latest, use PNPM instead of NPM.
---
@byigitt
byigitt / kyk-scraper.py
Created September 29, 2024 11:36
KYK Yemek Data Scraperi
import requests
from bs4 import BeautifulSoup
import json
import logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
links = [
"https://kykyemek.com/Menu/GetDailyMenu/Ankara?city=Ankara&mealType=false",
"https://kykyemek.com/Menu/GetDailyMenu/Ankara?city=Ankara&mealType=true",
@byigitt
byigitt / logdeleter.bat
Created September 3, 2024 13:00
a batch script to delete stuff
@echo off
:: Request Admin Permissions
>nul 2>&1 "%SYSTEMROOT%\system32\icacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
echo Now Running As Administrative Privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
@byigitt
byigitt / settings.json
Created April 1, 2024 20:34
my vscode settings
{
// Open json editor for settings
"workbench.settings.editor": "json",
// Theme
"workbench.colorTheme": "Min Dark",
"workbench.iconTheme": "moxer-icons",
"editor.smoothScrolling": true,
// Change font
@byigitt
byigitt / spotify.js
Created February 22, 2024 19:41
check spotify followers who you follow but they dont follow you back
const SPOTIFY_ID = "SPOTIFY ID";
const BASE_URL = "https://spclient.wg.spotify.com/user-profile-view/v3/profile/" + SPOTIFY_ID + "/";
(async () => {
let FOLLOWING_DATA = await fetch(BASE_URL + "following?market=from_token", {
headers: {
authorization:
"Bearer YOUR SPOTIFY AUTH TOKEN",
},
method: "GET",