Skip to content

Instantly share code, notes, and snippets.

View farukterzioglu's full-sized avatar
🎯
Focusing

Faruk Terzioğlu farukterzioglu

🎯
Focusing
View GitHub Profile
@farukterzioglu
farukterzioglu / CRTP.cs
Created June 30, 2017 08:32
Curiously Recurring Template Pattern (CRTP), (Generic, TDD, Fixture, SUT)
//Curiously Recurring Template Pattern (CRTP)
//http://zpbappi.com/curiously-recurring-template-pattern-in-csharp/
public interface IFixture<out TFixture, out TSut>
where TFixture : IFixture<TFixture, TSut>
where TSut : class
{
TFixture Setup();
TSut CreateSut();
}
@farukterzioglu
farukterzioglu / ajax
Last active July 3, 2017 10:56
Set $ ajax to send cookies
$.ajaxSetup({
xhrFields: {
withCredentials: true // This setting passes cookies along the request, including our authentication cookie.
}
});
using System;
using System.Runtime.CompilerServices;
using Xunit;
namespace Tests
{
public class Dto1{}
public class Dto2{}
public interface IDbModel
@farukterzioglu
farukterzioglu / ReturnCalculatedValue.cs
Created July 3, 2017 12:03
Mocking a method with calculated return value, instead of static return value. (Moq, TDD)
namespace MoqNotes
{
public interface ISubjectUnderTest
{
int GetData(int param);
}
public class Tests
{
[Fact]
@farukterzioglu
farukterzioglu / install-rabbitmq.sh
Created August 17, 2018 13:57 — forked from yetanotherchris/install-rabbitmq.sh
RabbitMQ on Docker with admin UI
# AWS specific install of Docker
sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo usermod -a -G docker ec2-user
# exit the SSH session, login again
# Docker
docker run -d --hostname my-rabbit --name some-rabbit -p 4369:4369 -p 5671:5671 -p 5672:5672 -p 15672:15672 rabbitmq
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=mybinary
BINARY_UNIX=$(BINARY_NAME)_unix
docker run -p 5000:80 -e CORE_ENVIRONMENT=prod similarityapi
docker run -p 5000:80 -e NETCORE_ENVIRONMENT=test similarityapi
https://git.hepsiburada.com/Hermes/product-similarity-finder.git
//dotnet docker file örnekleri
https://github.com/dotnet/dotnet-docker/tree/master/samples/dotnetapp
@farukterzioglu
farukterzioglu / btcd_pull_request_management.md
Created September 20, 2018 19:43 — forked from davecgh/btcd_pull_request_management.md
Managing a btcd Pull Request for Code Contibutions

Initial Preparation

The first step is to read the Code Contribution Guidelines documentation to get a good understanding of policies used by the project

Once that is done, the following commands illustrate a straight forward setup for submitting pull requests to the project:

One time setup

  • Fork btcd on github
  • Run the following command to obtain btcd, all dependencies, and install it (this has probably already been done):
@farukterzioglu
farukterzioglu / example_txscript_signaturescript.go
Created September 20, 2018 19:45 — forked from davecgh/example_txscript_signaturescript.go
Example of signing a transaction using txscript.SignatureScript
package main
import (
"encoding/hex"
"fmt"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"