Skip to content

Instantly share code, notes, and snippets.

View eftalyurtseven's full-sized avatar

Eftal Yurtseven eftalyurtseven

View GitHub Profile
@eftalyurtseven
eftalyurtseven / AwesomeNFT.sol
Created July 31, 2022 18:36
Awesome NFT minting contract file
pragma solidity ^0.8.4;
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
contract AwesomeNFTContract is ERC721, Ownable {
uint256 public mintPrice = 0.05 ether;
uint256 public totalSupply;
uint256 public maxSupply;
bool public isMintEnabled;
@eftalyurtseven
eftalyurtseven / trigger-auth.yaml
Created June 25, 2022 19:03
Example KEDA Trigger Authentication
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: keda-aws-credentials
namespace: keda-test
spec:
podIdentity:
provider: aws-eks
@eftalyurtseven
eftalyurtseven / example-scaledobject.yaml
Last active June 25, 2022 19:01
Scaledobject Example With SQS
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: aws-sqs-queue-scaledobject
namespace: keda-test
spec:
scaleTargetRef:
name: nginx-deployment
minReplicaCount: 0 # If the queue is empty we'll downscale to 0
maxReplicaCount: 5 # If queue size is more bigger than we think, KEDA will scale our pods maximum 5
@eftalyurtseven
eftalyurtseven / iam-role-trusted-entities.json
Created June 25, 2022 18:42
IAM Role Trusted Entities
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Federated": "<OIDC_PROVIDER_ARN>"
},
"Action": "sts:AssumeRoleWithWebIdentity",
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "sqs:GetQueueAttributes",
"Resource": "<SQS_QUEUE_ARN>"
}
]
}
func TestMakeAnOrderExecErr(t *testing.T) {
ctx := context.Background()
req := &orderRequest{
TableNumber: "B-1",
Products: map[string]int{
"Pizza": 5,
},
}
ctrl := gomock.NewController(t)
package order
import (
"context"
"eftal/medium/mocks"
"errors"
"fmt"
"testing"
"github.com/golang/mock/gomock"
package order
import (
"context"
"github.com/jackc/pgx/v4"
"github.com/jackc/pgx/v4/pgxpool"
)
type FakePool struct {
package order
import (
"context"
"errors"
"fmt"
"time"
"github.com/jackc/pgx/v4"
)
{
"table_number": "B-1",
"products": {
"Italian Pizza": 3,
"Chef's Special": 2,
"Water": 1,
"Beer": 2,
"Wine": 3
}
}