Skip to content

Instantly share code, notes, and snippets.

View abdivasiyev's full-sized avatar

Asliddinbek Azizovich abdivasiyev

View GitHub Profile
@abdivasiyev
abdivasiyev / heap.hs
Created December 4, 2025 14:54
Heap implementation in Haskell
module Heap where
data Heap a = Empty | Node a (Heap a) (Heap a) deriving (Show, Eq)
merge :: (Ord a) => Heap a -> Heap a -> Heap a
merge Empty h = h
merge h Empty = h
merge h1@(Node x l1 r1) h2@(Node y l2 r2)
| x >= y = Node x (merge r1 h2) l1
| otherwise = Node y (merge r2 h1) l2
@abdivasiyev
abdivasiyev / flake.nix
Created November 29, 2025 17:51
Setup development environment for Go compiler development
{
description = "Go compiler development environment";
nixConfig = {
allow-import-from-derivation = true;
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
@abdivasiyev
abdivasiyev / trash.als
Created October 16, 2025 03:44
Formal verification of Trash on Alloy 6
module Trash
var sig File {}
var sig Trash in File {}
fact init {
no Trash
}
@abdivasiyev
abdivasiyev / hosts
Created August 1, 2025 13:36 — forked from anilshanbhag/hosts
Hosts file to prevent google / youtube ads Paste the contents into /etc/hosts file in linux / mac
127.0.0.1 3ad.doubleclick.net
127.0.0.1 ad-emea.doubleclick.net
127.0.0.1 ad-g.doubleclick.net
127.0.0.1 ad-yt-bfp.doubleclick.net
127.0.0.1 ad.3au.doubleclick.net
127.0.0.1 ad.ae.doubleclick.net
127.0.0.1 ad.au.doubleclick.net
127.0.0.1 ad.be.doubleclick.net
127.0.0.1 ad.br.doubleclick.net
127.0.0.1 ad.de.doubleclick.net
@abdivasiyev
abdivasiyev / resource.go
Created June 16, 2025 09:25
Resource management using bracket pattern in Go
// package resource provides bracket pattern for
// resource management
package resource
import (
"fmt"
"mime/multipart"
"net/http"
"os"
)
@abdivasiyev
abdivasiyev / errorsx.go
Created April 25, 2025 06:05
Custom error struct for Go apps
package errorsx
import (
"errors"
"fmt"
"net/http"
)
type AppError struct {
message string
@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
@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 / 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 / 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"
)