Skip to content

Instantly share code, notes, and snippets.

View oguzhanvarsak's full-sized avatar

Oguzhan Varsak oguzhanvarsak

  • Motorola Solutions
  • Kraków, Poland
  • 19:12 (UTC +02:00)
View GitHub Profile
#include<stdio.h>
#include<stdlib.h>
struct node {
int data;
struct node *next;
struct node *prev;
}*head=NULL;
struct node *yeniNodeOlustur(int gelen){
@oguzhanvarsak
oguzhanvarsak / DoublyLinkedList.cpp
Last active November 1, 2020 16:31
Doubly Linked List - Çift Yönlü Bağlı Liste
/*
*************** RAPOR ***************
C++'da main() fonksiyonunu diğer fonksiyonlar içerisinden çağıramayacağımı öğrendim.
Bu yüzden istenen switch-case yapısını main() içerisinde hazırlamak yerine anamenu() isimli fonksiyonu tanımlayıp onun içerisinde hazırladım.
Çünkü programın işlemler tamamlandıktan sonra tekrardan ana menüye dönülecek şekilde çalışmasını istedim.
Bu şekilde ana menüye istediğim zaman dönüş yapıp tekrardan kullanıcı girdisi alabildim.
Diğer fonksiyonları başlangıçta tanımlayıp sonradan açıklamalarını yazmam gerekti çünkü anamenu() içerisinde kullanmam için fonksiyonların anamenu()
fonksiyonunun kendisinden önce tanımlanması gerekiyordu. Aynı kısıtlamadan dolayı anamenu() fonksiyonunu ise diğer fonksiyonlardan önce tanımladım.
Sonuç olarak böyle bir kod yapısı ortaya çıktı.
@oguzhanvarsak
oguzhanvarsak / CircularDoublyLinkedList.c
Last active November 1, 2020 16:33
Circular Doubly Linked List - Dairesel Çift Yönlü Bağlı Liste
/*
*************** RAPOR ***************
Onceki odevde ogrendigim gibi C++'da main() fonksiyonunu diger fonksiyonlar içerisinden cagirilamayacagindan tamamen C'ye gecmeye karar verdim.
Cogu kodu Doubly Linked List kodumdan aldim ve kullandim.
Silme isleminde tam cozemedigim bir durumdan dolayi tamamlayamadim. Kod sadece silinen degeri en sona atiyor. O kisim biraz karisikti bu yuzden bu sekilde biraktim.
Bu sefer node olusturmak icin ayri bir fonksiyon olusturdum. Arama ve Silme icin her olusturdugumda bir deger arttirdim.
Bu sayede DLL odevinde kullandigim while(temp->next != NULL) dongude en sona gelindiginde basa donme durumundan kurtulmak istedim.
Yeni bir for dongu kullanimi ogrendim, bu sekilde daha guzel gorundugunu dusundugumden cogunlukla for dongulerini o sekilde kullandım.
for (temp = head, i = 0;i < number;i++,temp = temp->next)
@oguzhanvarsak
oguzhanvarsak / Questions.m
Last active March 20, 2021 20:57
Write code to find the first prime fibonacci number larger than a given minimum, Use your code to compute the smallest prime fibonacci number 
greater than 227,000 (X) and find the sum of prime divisors of X + 1.
//
// main.m
//
//
// Created by Oğuzhan Varsak on 29.12.2020.
//
#import <Foundation/Foundation.h>
int Fibb(int number);
@oguzhanvarsak
oguzhanvarsak / delete-likes-from-twitter.md
Created March 21, 2021 16:42
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@oguzhanvarsak
oguzhanvarsak / simctl-utils.md
Last active March 26, 2021 16:12
Take a screenshot and record a video in iOS Simulator

There would be a time when you need to capture your app screen or record a video of your app, whether for an App Store screenshot or an App Store preview video. You can do all of this without external tools.

Take a screenshot

An easy way

For taking a screenshot, I usually launch an app in the Simulator and press ⌘ - command + s or File > New Screen Shot. The screenshot will be saved to your Desktop.

Xcrun

@oguzhanvarsak
oguzhanvarsak / boardingpass.pass
Last active August 24, 2021 11:35
Template boarding pass
{
"description" : "Boarding pass for October 4, San Francisco to London",
"formatVersion" : 1,
"passTypeIdentifier" : "pass.com.example.boarding-pass",
"serialNumber" : "123456",
"boardingPass" : {
<<field dictionaries>>
}
}
{
"description" : "Boarding pass for October 4, San Francisco to London",
"formatVersion" : 1,
"passTypeIdentifier" : "pass.com.example.boarding-pass",
"serialNumber" : "123456",
"boardingPass" : {
"primaryFields" : [
{
"key" : "origin",
"label" : "San Francisco",
@oguzhanvarsak
oguzhanvarsak / backfields.pass
Created August 24, 2021 12:24
Back Fields Pass Template
{
...
"backFields" : [
{
"key" : "frequent-flier-number",
"label" : "Frequent flier number",
"value" : "1234-5678"
},
{
@oguzhanvarsak
oguzhanvarsak / barcodefield.pass
Last active August 24, 2021 12:38
Barcode field
{
...
"barcodes" : [
{
"message" : "ABCD 123 EFGH 456 IJKL 789 MNOP",
"format" : "PKBarcodeFormatQR",
"messageEncoding" : "iso-8859-1"
}
]