Skip to content

Instantly share code, notes, and snippets.

@Yengas
Yengas / json-resume.json
Created February 26, 2023 19:50
Yiğitcan UÇUM - JSON Resume - 2023 Feb
{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Yiğitcan UÇUM",
"label": "Staff Software Engineer",
"image": "https://www.gravatar.com/avatar/6900201177f2da2ec0fa993f04e0b851?s=400",
"summary": "An action-oriented hard worker. A wide range of experience with various programming languages and platforms. Specialized in high-scale backend development, cloud native technologies, and CI/CD environments.",
"website": "https://yigitcan.dev",
@Yengas
Yengas / 1-README.md
Last active April 18, 2022 13:33
uniformly distributed points inside a geojson feature / polygon

Description

This script generates points inside a given geojson feature / polygon using turf.

You can use geojson for visualization or creating your own geojson by hand.

Input

image

Output

image

@Yengas
Yengas / 01-Examples.md
Last active August 23, 2023 21:05
Examples in Implementing Domain Driven Design

Chapter 1 - Getting Started with DDD

BacklogItem is modeled two different ways. First one is the anemic model where we only have getters and setters on the BacklogItem. Making it pretty much the "domain" version of the database model we have in our minds.

The second one is a richer BacklogItem that has logic to uncommit / commit to a new sprint. E.g. All of the logics related to "committing to a sprint" are put into the BacklogItem's #commitTo. Creating high cohesion. BacklogItem emits an event after comitting to the sprint. This way other actors in the same/different bounded context can be notified of the changes.

Private/Protected methods + different #uncommitFrom are highlighted to show how they are helpful to implement #commitTo and other usecases.

Chapter 2 - Domains, Subdomains, and Bounded Contexts

"When a user is browsing the Catalog, Customer means one thing, but when a user is placing an Order, it means something else." Each domain expert things of something else.

@Yengas
Yengas / 01-request.js
Last active March 18, 2021 01:03
a simple promise returning request function for http and https get, post
const http = require("http");
const https = require("https");
function request(options) {
return new Promise((resolve, reject) => {
const { url, data, ...rest } = options;
const parsedURL = new URL(url);
const isHTTPS = parsedURL.protocol === "https:";
const lib = isHTTPS ? https : http;
export class ProductIntersectionRepository {
constructor(private readonly postgreSQLAdapter: PostgreSQLAdapter)
async getActiveAdvertisementProducts(
query: ProductIntersectionQuery
): Promise<AdvertisementWithProducts[]>
}
type ProductIntersectionQuery = {
sellerID: number;
const postgreSQLAdapter: PostgreSQLAdapter = (global as any).postgreSQLAdapter;
const adRepository = new AdvertisementRepository(postgreSQLAdapter);
const repository = new ProductIntersectionRepository(postgreSQLAdapter);
describe('ProductIntersectionRepository', () => {
const UUID_PREFIX = 'f4f4c9e3-a077-4f3c-bf73-9c54cb57ffa';
beforeEach(async () => {
await postgreSQLAdapter.query('DELETE FROM advertisements');
await postgreSQLAdapter.query('DELETE FROM advertisement_products');
name: 'Lint and Tests'
on: push
jobs:
test:
name: Lint and Test Code Base
runs-on: ubuntu-latest
strategy:
@Yengas
Yengas / 01-gitlab-ci.yml
Last active October 12, 2022 13:56
Gitlab CI YML for running Testcontainers tests in Gitlab
stages:
- test
integration-test:
extends: .node-cache
stage: test
image: node:14-alpine
services:
- name: docker:20.10.1-dind
@Yengas
Yengas / jest-testcontainers-config.js
Created December 12, 2020 19:00
testing database layer with node.js
module.exports = {
postgre: {
image: 'postgres',
tag: '12.3-alpine',
ports: [5432],
env: {
POSTGRES_PASSWORD: 'integration-pass',
},
wait: {
type: 'text',