Pubky is a collection of opensource protocols and tools to keep web unstoppable
Official web site: https://pubky.org/
I started to share "what i learned today". Mostly there will be snippets and short contents
Pubky is a collection of opensource protocols and tools to keep web unstoppable
Official web site: https://pubky.org/
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
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:
Hamur icin:
Harc icin:
Ustu icin:
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!
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.
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!
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.
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
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.
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 :)
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.
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.
There is tool named bgrem
for using image models to remove backgrounds
pipenv shell
pipenv install bgrem[cli]
bgrem i file.jpg output-file.jpg
i
argument for specifing input file
s
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.
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
To create custom content types just create a new folder inside content folder.
Started Today I Learned
contents.