Skip to content

Instantly share code, notes, and snippets.

View tarikguney's full-sized avatar
💭
Life has been an interesting ride.

Tarik Guney tarikguney

💭
Life has been an interesting ride.
View GitHub Profile
@tarikguney
tarikguney / userscript.js
Last active December 8, 2023 15:07
Eat Your Food - Netflix Interruptor
// ==UserScript==
// @name Remember to eat your food while watching Netflix
// @namespace https://www.tarikguney.com
// @version 0.1
// @description Kids watching cartoons on Netflix often forget to eat and chew their food, which drives parents crazy. You need to sit down with them and pause the video and remind them to eat their food. This script will automate that.
// @author Tarik Guney
// @match https://www.netflix.com/watch/*
// @icon https://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Netflix_icon.svg/1200px-Netflix_icon.svg.png
// @grant none
// ==/UserScript==
@tarikguney
tarikguney / iterator_pattern_sample.cs
Last active February 10, 2020 02:43
Iterator Pattern Sample: Collecting money from briefcase
class Program {
static void Main(){
Canta paraDoluCanta = new Canta();
var zengin = new Yazilimci(paraDoluCanta) { Isim="Tosun", Yas=21 }
// Zengin birisi olarak, farkli ozelliklerimi farkli siniflar ile temsil ediyorum.
// Mesela para sayma ozelligim: ParaSayar, saldiri ozelligim: HizliVeOfkeli, vs.
// GetIterator() genelde standard bir isim. Onun icin kullandim. Geriye Iterator ustipinden ParaSayar tipini gonderiyor.
ParaSaymaIterator paraSayanOzelligim = zengin.GetIterator();
double toplamPara = 0;
@tarikguney
tarikguney / login-form.component.css
Last active September 30, 2023 11:22
Login Form Design in Angular Material
.login-form-flex {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
.button-flex-container {
display: flex;
width: 100%;
public class AccountChecker{
public bool Exists(Account account){
//....
}
public bool ExistsInAmazonWebServices(Account account){
//....
}
public bool ExistsInAzure(Account account){
//....
@tarikguney
tarikguney / aggregation-with-inheritance.cs
Created October 8, 2017 19:35
Aggregation with inheritance
public class Account{
private ILogin _loginInfo;
private IProfile _profileInfo;
public Account(IProfile profileInfo, ILogin loginInfo){
_loginInfo = loginInfo;
_profileInfo = profileInfo;
}
}
@tarikguney
tarikguney / Aggregation.cs
Created October 8, 2017 18:59
Composition vs. Aggregation
public class Account {
private Profile _profileInfo;
private Login _loginInfo;
public Account(Profile profileInfo, Login loginInfo){
_profile = profileInfo;
_loginInfo = loginInfo;
}
}
@tarikguney
tarikguney / http_get.go
Created July 12, 2017 19:49 — forked from ijt/http_get.go
Example of using http.Get in go (golang)
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
@tarikguney
tarikguney / Unit-test-example-for-medium.cs
Created February 3, 2017 07:01
Unit Test Example for Medium
public class AccountCreatorTest{
private IAccountChecker _accountCheckerMock;
private IAccountRepository _accountRepositoryMock;
[TestInitialize]
public void Initialize(){
_accountCheckerMock = new AccountCheckerMock();
_accountRepositoryMock = new AccountRepositoryMock();
}
@tarikguney
tarikguney / unit-test-dependency-injection.cs
Last active February 3, 2017 04:31
Unit Testing with Dependency Injection
public class AccountCreator{
// Interface'ler tanımlıyoruz. Dolayısıyla kendi sınıflarımızı rahatlıkla kullanabiliriz.
private IAccountChecker _accountChecker;
private IAccountRepository _accountRepository;
// Dependency'lerimizi constructor method vasıtasıyla enjekte ediyoruz.
public AccountCreator(IAccountChecker accountChecker, IAccountRepository accountRepository){
_accountChecker = accountChecker;
_accountRepository = new accountRepository;
}
@tarikguney
tarikguney / ninject-code-sample.cs
Created January 31, 2017 08:19
Ninject Code Sample
public class WarriorModule : NinjectModule
{
public override void Load()
{
this.Bind<IWeapon>().To<Sword>();
}
}