Skip to content

Instantly share code, notes, and snippets.

View abdivasiyev's full-sized avatar
🥷
golang ninja

Asliddinbek Azizovich abdivasiyev

🥷
golang ninja
View GitHub Profile
package http
import (
"context"
"encoding/json"
"mime/multipart"
"net/http"
"github.com/go-chi/chi/v5"
"github.com/google/uuid"
@abdivasiyev
abdivasiyev / repository.go
Last active April 21, 2024 16:15
Repository for dynamic insertion
package repository
import (
"fmt"
"strings"
)
type Row interface {
SetPos(pos int)
Values() []any
@abdivasiyev
abdivasiyev / optional.go
Created May 1, 2024 17:39
Optional arguments implementation
// Usage:
//
// SomeFn(1, "test", WithArg1("optional 1"), WithArg2(true))
//
package some_pkg
type Option func(*option)
type option struct {
arg1 string
@abdivasiyev
abdivasiyev / generic_setter.go
Created May 1, 2024 18:32
Set value by calling functions in generics
package main
import "fmt"
type Setter[V any] interface {
Set(value V)
}
type Getter[V any] interface {
Get() V
@abdivasiyev
abdivasiyev / workerpool.go
Last active May 22, 2024 21:16
Goroutine management by using workerpool pattern
package workerpool
type Work[T any] func(workerID int, result chan<- T) error
type Pool[T any] interface {
Add(w Work[T])
Shutdown()
Result() <-chan T
}
@abdivasiyev
abdivasiyev / decoder.go
Created August 3, 2024 12:29
Decode everything using only one package
package decoder
import (
"encoding/json"
"io"
"net/http"
"github.com/gorilla/schema"
)
@abdivasiyev
abdivasiyev / subdomains.sh
Created November 6, 2024 05:00
Find subdomains using crt.sh
#!/bin/bash
# check curl exists
if ! command -v curl >/dev/null 2>&1
then
sudo apt install -y curl
fi
# check pup exists
if ! command -v pup >/dev/null 2>&1
@abdivasiyev
abdivasiyev / Git_Commit_Freeze_Solution.md
Created January 15, 2025 09:30 — forked from bahadiraraz/Git_Commit_Freeze_Solution.md
Git Commit Freeze Due to GPG Lock Issues (Solution)

Git Commit Freeze Due to GPG Lock Issues

If you encounter a problem where you cannot commit changes in Git – neither through the terminal nor via the GitHub Desktop application – the issue might be a freeze during the Git commit process. This is often caused by GPG lock issues. Below is a concise and step-by-step guide to resolve this problem.

Solution Steps

1. Check for GPG Lock Messages

Open your terminal and try to perform a GPG operation (like signing a test message). If you see repeated messages like gpg: waiting for lock (held by [process_id]) ..., it indicates a lock issue.

@abdivasiyev
abdivasiyev / Crossover.sh
Created April 21, 2025 19:59 — forked from ellsies/Crossover.sh
Crackover (Complete free version of crossover)
#!/usr/bin/env bash
# checck if pidof exists
PIDOF="$(which pidof)"
# and if not - install it
(test "${PIDOF}" && test -f "${PIDOF}") || brew install pidof
# find app in default paths
CO_PWD=~/Applications/CrossOver.app/Contents/MacOS
test -d "${CO_PWD}" || CO_PWD=/Applications/CrossOver.app/Contents/MacOS