I realized there is visibilitychange
event in web api when I enter instagram on pc, and the instagram stops playin reels when i go to another tab. I didn’t know that event exists. You can know the tab is visible or hidden with that. mozmdn-visibilitychange
Today I Learned
I started to share "what i learned today". Mostly there will be snippets and short contents
- TIL #14
- TIL #13
- TIL #12
Borekitas / Empanada Ispanya’dan gocen seferadlarin mutfagina ait bir lezzet. Ladinolar Empanada’yi Borekitas olarak cevirmisler, bu da borekcik demekmis. Empanada farkili cesitlerde olabiliyor ama borekitas sadece patates ve patlicandan yapilirmis. 185 derece firinda alt-ust fanli olacak sekilde aciyoruz.
Onemli noktalar:
- patlicanlar kozlenecek ama cekirdeksiz olacak
- mutlaka aycicek yagi ve oda sicakliginda
- su +4 derece olacak
- italyanlar limon ispanyollar sirke kullaniyor, beyaz sarap sirkesi daha iyi oluyor.
- un mutlaka elenmeli, yavas yavas eklenmeli, ekmek unu kullanilmali.
- olculer 10-12 adet icin
- patatesli yapilacagi zaman 50gr kasar rendesi ekleniyor hamura
- koser bir mutfak oldugu icin tereyagi kullanilmiyor, bazi tariflerde tereyagi yazabilir, kullanmak isteyen kullanabilir. Orjinalinde yok.
- hamur yapildiktan sonra el gucuyle hamurun bir kismini aciyoruz, eger acilan hamuru yapistigi yerden kaldirirken yirtilmiyorsa hamur tamamdir.
- dolaba koymuyoruz hamuru kesinlikle.
- tuz-karabiber damak tadina gore harca eklenebilir.
- tepeleme olmasi Onemli
- hamur ne kadar ince o kadar iyi
- hamur tek seferde acilirsa, yeterince ince olamayip, parcalar cikartildiktan sonra tekrar acmak gerekebiliyormus.
- yumurta sarisini biraz sulandirmak daha iyi olur.
Hamur icin:
- aycicek yagi 1 cay bardagi
- yarim cay bardagi soguk su
- bir tatli kasigi sirke
- 400gr un
Harc icin:
- 2 adet koz patlican
- 50gr beyaz peynir
- 50gr eski kasar
Ustu icin:
- yumurta sarisi
- eski kasar
Hamur hazirlandiktan sonra hamurdan parcalar koparip ince bir sekilde uzunlamasina aciyoruz. Harcini icine bir yemek kasigiyla koyup kapatiyoruz. Kenarlarini parmaklarinizla iyi ve nazik bastirmak gerekiyor, pisince acilmasin. Son sekli vermek icin ortada kalan tepeyi bardakla kesiyoruz, dis parcalari ayiriyoruz, acilirsa catalla da kapatabilirsiniz kalan kenarlari, veya hamur kenarlarini dantel tarzi orebilirsiniz. Empanada kaliplariyla yapilmiyor cunku hamuru tutmuyor. En son tepsiye dizip uzerine yumurta surup, ince olacak sekilde eski kasar rendeleniyor. Firina atiliyor Afiyet olsun!
- TIL #11
I recently decided to give the Zed editor a try. I’ve been using Vim for years (and Linux-as-an-IDE), but Zed caught my eye with its modern features, so I thought I’d check it out.
Everything about Zed seems great, and I honestly think it’s one of the best editors out there. However, I couldn’t shake the feeling of something being off, even when using Vim mode. Now I understand why they mention it’s 90% compatible with Vim.
In the end, I’ll be sticking with Vim and Linux-as-an-IDE. But I do recommend that every developer give Zed a shot—it’s worth exploring. You can check it out at zed.dev.
- TIL #10
Adding Soft-Delete in PostgreSQL Without Changing Code
I recently needed to add a soft-delete feature to my application. However, I didn’t want to modify the existing program code. Instead, I leveraged PostgreSQL’s rule system to achieve this. Here’s how I did it:
I created a migration that automatically logs deleted rows into a separate table whenever a
DELETE
statement is executed. This ensures the original data is preserved.CREATE TABLE deleted_data ( id SERIAL PRIMARY KEY, table_name TEXT NOT NULL, row_data JSONB NOT NULL, deleted_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); CREATE RULE log_course_deletion AS ON DELETE TO course DO ALSO INSERT INTO deleted_data (table_name, row_data) VALUES ('course', row_to_json(OLD));
With this setup, every time a row is deleted from the course table, it is automatically inserted into the deleted_data table. This way, I can retrieve the deleted data whenever I need it by running a simple query:
SELECT row_data FROM deleted_data WHERE table_name = 'your_table_name' AND row_data->>'id' = 'your_id';
This solution allowed me to implement soft-delete functionality without altering my existing program code. Simple and effective!
- TIL #09
Today I saw utteranc.es in a blog and i liked it. So I’ve decided to add same comment to my blog. Replaced with disqus (which already its not working). You can see comment for below of the every post. You need to login with your github account if you want to write comments.
- TIL #08
Julian Day or Julian Day Number (JDN) is a date format. Its the number of days that have passed since 1 January 4713 BC in Julian Calendar
And my birthday in that format is 2447579
- TIL #07
I am not fan o em unit to give sizes to html content. But unfortunately I have to work with other developers sometimes. So, some of those likes to use
em
unit but they have no idea how the em works. Yes I don’t have idea until today. So I have to learn the calculation of em.Let me share with you too.
EM is relative unit to the nearest parent font-size. So, if you use EM, it means, parent font size X em value.
<div style="font-size: 16px"> I am the normal text <span style="font-size: 0.9em">Hey I am smaller text</span> </div> ` So, the smaller text's font size is `14.4px` Still I do not like em units.
- TIL #06
Today I learned how can i create a rust cli application with help of ai.
I’ve created this tool for managing TIL records. Now I can add more til’s without worring to creating new file and committing etc.
https://github.com/delirehberi/tiller
I am very happy about it :)
- TIL #05
Point-free Programming / Tacit Programming
Bu konuda yeterince ingilizce içerik var zaten. Türkçe olarak açıklarsam fonksiyonu tanımlarken alacağı parametreyi belirtmediğinizde point-free programlama yapıyorsunuz. Buradaki point kelimesi “.” manasında değil. Aksine bolca “.” operatörü ile birleştirme yapılabilmesi için de çok güzel oluyor. Çok nokta görünüyor yani bu tarzda.
birekle :: Int -> Int birekle sayi = sayi + 1 birekle = (+) 1 --pointfree
Okunabilirlik konusunda ise “okunabilirlik aşinalıktır” lafına bakarsak bu tarzı benimsediğinizde daha okunabilir bir tarz oluyor.
- TIL #04
Zero Knowledge Proof
There is a way to get proof for “thing” without getting any “sensitive” or “private” information from.
BUT for now its to expensive to implement for tiny projects. Calculations requires a lot costs.
- TIL #02
There is tool named
bgrem
for using image models to remove backgroundspipenv shell pipenv install bgrem[cli] bgrem i file.jpg output-file.jpg
i
argument for specifing input files
argument runs a server and web-ui on port 5000 to use models.First usage of model requires download. So it will take a little bit time to complete at first run of model.
- TIL #03
Yarn issue
Error: tunneling socket could not be established, statusCode=400 Cause: Proxy config in yarn Solution:
yarn config delete https-proxy yarn config delete proxy
- TIL #01
To create custom content types just create a new folder inside content folder.
Started
Today I Learned
contents.