Skip to content

Instantly share code, notes, and snippets.

@navferty
navferty / Lesson4.cs
Created March 28, 2022 18:55
NoobCoder's lesson 4
namespace ConsoleLesson4;
class Program
{
static void Main(string[] args)
{
//1.1 Пример программы без условных конструкций
{
Console.WriteLine("Введите первое слагаемое: ");
int a = Convert.ToInt32(Console.ReadLine());
@navferty
navferty / Program.cs
Last active June 16, 2022 12:09
NoobCoder’s Lesson 9 - Lists
using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace App
{
public class Program
{
static readonly Random random = new();
using Microsoft.EntityFrameworkCore;
using Npgsql;
using Npgsql.NameTranslation;
var context = new Ctx();
/*
CREATE TYPE enum_encounter_batch_item_status AS ENUM ('Invalid', 'Processed');
create table "Items"

Coding tasks

Coding: Memory cache

Create a memory cache. It's main API - method GetOrAdd(key, valueFactory, token). Cache should return value by key, if the value is present. Otherwise, it should asynchronously invoke valueFactory to get value, and store value that was returned.

If second call with same key is performed, while first call is still executing, it should not perform additional valueFactory invocation.

public interface ICache
@navferty
navferty / docker-compose.yml
Created June 25, 2024 17:06 — forked from denisxab/docker-compose.yml
Настройка собственного GitLab CI/CD сервера с помощью Docker Compose
version: "3.5"
services:
gitlab:
image: gitlab/gitlab-ce:latest
hostname: "localhost"
restart: unless-stopped
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://localhost'
gitlab_rails['gitlab_shell_ssh_port'] = 8822