Skip to content

Instantly share code, notes, and snippets.

View IlyaGulya's full-sized avatar

Ilya Gulya IlyaGulya

View GitHub Profile
@IlyaGulya
IlyaGulya / .claude-settings.json
Created February 10, 2026 08:31
Claude Code 1password CLI + macos keychain secret storage
{
"hooks": {
"SessionStart": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": ".claude/hooks/cache-loki-password.sh",
"timeout": 30000
#!/bin/bash
# UserPromptSubmit hook for activating skills
#
# If the project has its own hook — do not run (avoid duplicates)
if [[ -n "$CLAUDE_PROJECT_DIR" && -f "$CLAUDE_PROJECT_DIR/.claude/hooks/skill-activation.sh" ]]; then
exit 0
fi
# Helper function to check if a directory has any entries
dir_has_entries() {
@IlyaGulya
IlyaGulya / testcontainers_embed.go
Created August 14, 2025 13:52
converts an embedded filesystem directory to ContainerFile slice
import (
"fmt"
"io/fs"
"path/filepath"
"strings"
"github.com/testcontainers/testcontainers-go"
)
// EmbedToContainerFiles converts an embedded filesystem directory to ContainerFile slice
@IlyaGulya
IlyaGulya / vault-pass.sh
Last active August 10, 2025 15:31
Bitwarden Ansible vault password daemon
#!/bin/bash
# Set required Bitwarden item name
export VAULT_SECRETD_BW_ITEM="Ansible vault key" # CHANGE THIS VALUE TO NAME OF YOUR BITWARDEN PASSWORD ITEM
# Ansible Vault password script using vault_secretd.py daemon
set -euo pipefail
die(){ echo "ERROR: $*" >&2; exit 1; }
import dagger.Component
import javax.inject.Inject
import javax.inject.Singleton
// ===== Shared Singleton =====
@Singleton
class SharedService @Inject constructor() {
val id = System.identityHashCode(this)
}
import okhttp3.*
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import java.io.IOException
// Inner interceptor that simulates a failure
class FailingInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
throw IOException("Simulated network error from FailingInterceptor")
}
}
@IlyaGulya
IlyaGulya / hammerspoon_init.lua
Created April 18, 2025 19:23
Kitty + Hammerspoon configuration with quake-like terminal style. Dock-aware (in case your dock is on the left).
local spaces = require("hs.spaces")
-- (Optional) helper to read dock position
local function dockOrientation()
local out = hs.execute("defaults read com.apple.dock orientation")
return out:match("^%s*(%S+)")
end
-- get the main window of an app (wait until it's ready)
local function getMainWindow(app)

1. Основы CI/CD

  • Определение CI (Continuous Integration):
    • Что такое непрерывная интеграция.
    • Цель: автоматизация сборки, тестирования и линтинга для уменьшения влияния человеческого фактора.
  • Определение CD (Continuous Deployment/Delivery):
    • Различие между Continuous Deployment и Continuous Delivery.
    • Особенности мобильной разработки: обязательное ревью в магазинах приложений.

@IlyaGulya
IlyaGulya / HiddenAwareLifecycle.kt
Created April 2, 2024 14:55
Lifecycle implementation that handles fragment hidden state changes
class HiddenAwareLifecycle(
fragment: Fragment,
) : LifecycleRegistry(fragment) {
init {
fragment.lifecycle.addObserver(
object : DefaultLifecycleObserver {
override fun onCreate(owner: LifecycleOwner) {
currentState = State.CREATED
}
@IlyaGulya
IlyaGulya / Example.kt
Last active December 10, 2021 12:25
Animated image example
@JvmInline
value class ImageId(val id: String)
@Preview
@Composable
fun Test() {
val images = emptyList<ImageId>()
var animatingImageId by remember {
mutableStateOf<ImageId?>(null)