Skip to content

Instantly share code, notes, and snippets.

View yusufpapurcu's full-sized avatar
🫖
I'm a teapot

Yusuf Papurcu yusufpapurcu

🫖
I'm a teapot
View GitHub Profile
@yusufpapurcu
yusufpapurcu / psuedo.txt
Created December 24, 2023 15:08
erdem psuedo solution
while (yiginDizi.size() != 1){
kopyaYiginDizi // yigin dizisinin kopyasini aliyoruz
silinecekYiginIndeks; // her while turunda bir yigin silmemiz lazim
operasyonTuru = 0; // enKucuk > enBuyuk > enKucuk.... seklinde her tur otekine bakmamiz lazim
while (silinecekYiginIndeks == NULL) {
int enKucuk = INT_MAX; // klasik taktik, ilk iterasyonda degismesini garantilemek icin
int enBuyuk = INT_MIN;
int silinecekEleman = 0; // hangi yigindan eleman cikaracagimizin indeksi
for (kopyaYigin: kopyaYiginDizi){
if (yigin == NULL) { // null pointer yememek icin
#include <stdio.h>
int getInput(const char *const _Format, ...);
const float midterm_ratio = 0.6;
const float final_ratio = 0.4;
int main()
{
printf("DERS ORTALAMASI HESAPLAMA\n");
printf("-----------------------------------\n");
#include <stdio.h>
int main()
{
const float midterm_ratio = 0.6;
const float final_ratio = 0.4;
printf("DERS ORTALAMASI HESAPLAMA\n");
printf("-----------------------------------\n");
printf("OGRENCI SAYISINI GIRINIZ:");

#sleep

The headline/summary from the video

Sleep 7-9hr per day

Don't be a freak on it, doesn't matter that much if you miss a point.

create a schedule to sleep

There is a thing called "Homeostatic sleep drive"(HSE)[^1] determines when we feel awake or tired. It uses a chemical called Adenosine. Sleep schedule thingy helps us to create a better HSE. If we wakeup/sleep at same time for long period, HSE will build up and makes us feel better. Try to sleep/wake-up similar times everyday. Holidays are no exception.

@yusufpapurcu
yusufpapurcu / markread.md
Created November 20, 2022 16:20
Easy way to mark everything read on your gmail account.

How to mark all emails as read?

Search for label:inbox is:unread. After you will see Select all messages match click it and say Mark as Read. It will ask for bulk operation cofirmation.

And here you go all of unread mails are marked as read 🚀

@yusufpapurcu
yusufpapurcu / talk.md
Last active April 29, 2022 18:53
Lightning Talk - Graceful Shutdowns (Cancellation and Signals)

1st Slide

About Me

Bla bla bla

2nd Slide

What is graceful shutdown?

Graceful shutdown means your OS know you want to close computer. It saves your changes at MS Office. Or you can force shutdown by keep pressing power buton for 10 second. But If you do this you can lost your data at MS Office. Data loss probably the one of the minimum amount of damage that you will get. It can cause hardware problems.

package main
import (
"encoding/json"
"fmt"
)
var raw_data = `{
"FullName":"Yusuf Turhan Papurcu",
"Email":"yusufturhanp@gmail.com",
package main
import (
"encoding/json"
"fmt"
)
func main() {
a := emailCover{Email: "12323", CreatedAt: "1213123", FullName: "321321", CreditCardInfo: "123213", Items: "21323"}
str, err := json.Marshal(a)
package main
import (
"encoding/json"
"fmt"
)
func main() {
a := cover{Field1: "12323", Field2: "1213123", Field3: "321321", Field4: "123213", Field5: "21323", Field6: "123123"}
str, err := json.Marshal(a)