Skip to content

Instantly share code, notes, and snippets.

View potat-dev's full-sized avatar
🥔
Котик крутится, лабы мутятся

Denis Churilov potat-dev

🥔
Котик крутится, лабы мутятся
View GitHub Profile

As a Senior DevOps Engineer and Architect, I can tell you that you've hit one of the most common limitations of the GitLab CI YAML engine: GitLab does not natively support deep-merging dictionaries inside an array element (which is what workflow:rules is).

If you define a rule as a list item (e.g., - if: ...) and use !reference, GitLab treats that list item as a single block. You cannot easily inject or override variables inside it at the point of reference.

However, we can elegantly bypass this limitation by using what I call the "Nested Hash Extension" pattern.

Instead of defining your rules as an array in the common repo, we define them as a nested hash (dictionary). We then leverage GitLab's extends keyword (which does support deep-merging dictionaries, unlike arrays) to merge your custom variables in the child repository, and finally inject the resulting hash into workflow:rules using !reference.

@potat-dev
potat-dev / totally-not-a-virus.ps1
Last active June 17, 2025 22:02
PowerShell script to download and run the latest zapret-discord-youtube release
# Config
$repo = 'Flowseal/zapret-discord-youtube'
$installDir = Join-Path $env:LOCALAPPDATA 'zapret'
# Fetch the latest GitHub release info
Write-Host "Checking latest release..."
$apiUrl = "https://api.github.com/repos/$repo/releases/latest"
$release = Invoke-RestMethod -Uri $apiUrl -UseBasicParsing
# Look for a .rar asset in the release
@potat-dev
potat-dev / mal-catppuccin-macchiato.css
Created May 10, 2025 03:41
Catppuccin Macchiato Theme for MyAnimeList Modern
/**
* Catppuccin Macchiato Theme for MyAnimeList Modern
* Created wuth ❤ by potatdev
*/
:root {
--base: #24273a;
--mantle: #1e2030;
--crust: #181926;
--text: #cad3f5;
@potat-dev
potat-dev / philosiphers.go
Created March 16, 2025 05:21
Dining philosophers problem in Golang
package main
import (
"context"
"fmt"
"os"
"sync"
"time"
)
@potat-dev
potat-dev / image-to-webp-compressor.py
Last active February 23, 2025 01:44
Batch compression of images to Webp with specified quality
import os
import signal
import argparse
from PIL import Image
from pathlib import Path
from tqdm import tqdm
from multiprocessing import Pool, cpu_count, current_process
SUPPORTED_FORMATS = (
".jpg",
@potat-dev
potat-dev / fix-timestamps.ps1
Last active January 27, 2025 02:50
Fix Invalid File Timestamps Powershell Script for Windows
param(
[string]$Path = ".",
[switch]$Recursive
)
$currentDate = Get-Date
$minDate = Get-Date "1980-01-01"
$scriptPath = $MyInvocation.MyCommand.Path
$params = @{
@potat-dev
potat-dev / trofimov_solver.py
Last active January 9, 2025 11:51
Trofimov Solver
import galois
import io
class StringIOWithEnd(io.StringIO):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.end = "\n"
def write(self, s="", end="\n"):
@potat-dev
potat-dev / ImELORa.py
Created December 6, 2024 02:57
Image Comparison ELO Rater
import os
import random
import json
import tkinter as tk
from tkinter import messagebox, filedialog
from PIL import Image, ImageTk
from collections import deque
class ImageComparisonApp:
def __init__(self, master):
@potat-dev
potat-dev / Резюме-Dev-Ops.md
Last active November 13, 2024 19:52
Мое резюме на позицию DevOps Engineer в компанию YADRO

Опыт связанный с DevOps

Автоматизация и CI/CD

  • Использовал GitHub Actions для сборки проектов, генерации документации, деплоя, прогона автотестов, публикации артефактов (напр. Docker images). Также базово знаком с GitLab CI
  • Умею работать с Git, использовал pre commit hooks, например для локального прогона тестов, проверки стиля кода или предотвращения утечки секретов
  • Имею опыт написания скриптов для автоматизации на Python, Bash, PowerShell
  • Базово работал с Ansible и Terraform

Контейнеризация и Оркестрация

@potat-dev
potat-dev / lab4-char-freq-anal-and-codes.py
Last active November 6, 2024 16:25
takes a text string and creates different types of binary codes for it (Huffman, Shannon, Gilbert-Moore)
import math
from collections import Counter, defaultdict
from typing import Dict, List, Tuple
def calculate_frequencies(text: str) -> Dict[str, float]:
print(f"\nДлина текста: {len(text)} символов")
# Count occurrences
counts = Counter(text)
print("\nКоличество каждого символа:")