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
@abdivasiyev
abdivasiyev / latest-protobuf-ubuntu-18-04.md
Created July 30, 2021 21:23 — forked from diegopacheco/latest-protobuf-ubuntu-18-04.md
How to Install Latest Protobuf on Ubuntu 18.04
sudo apt-get install autoconf automake libtool curl make g++ unzip -y
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
make
make check
sudo make install
sudo ldconfig
@abdivasiyev
abdivasiyev / bubble_sort.go
Last active February 26, 2022 20:59
Bubble sorting implementation golang
package sorting
// Bubble sorts the given slice of integers in ascending order with bubble sort algorithm.
func Bubble(numbers []int) {
size := len(numbers)
for i:=0; i<size; i++ {
for j:=0; j<i; j++ {
if numbers[j] > numbers[i] {
numbers[j], numbers[i] = numbers[i], numbers[j]
@abdivasiyev
abdivasiyev / selection_sort.go
Created April 17, 2022 21:27
Selection sort algorithm implementation
package sorting
// Selection sorts given list
func Selection(list []int) []int {
// return list if empty or has single element
if len(list) <= 1 {
return list
}
// iterate list elements
@abdivasiyev
abdivasiyev / colors.go
Created August 2, 2022 09:45 — forked from i0bj/colors.go
Golang colors
package main
import "fmt"
var (
Info = Teal
Warn = Yellow
Fata = Red
)
@abdivasiyev
abdivasiyev / .tmux.conf
Last active June 21, 2023 01:26
Tmux config
# Use Alt-arrow keys to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
@abdivasiyev
abdivasiyev / init.nvim
Created October 20, 2022 07:46
Neovim configuration
call plug#begin()
Plug 'jiangmiao/auto-pairs'
Plug 'preservim/nerdcommenter'
Plug 'preservim/tagbar'
Plug 'preservim/nerdtree'
Plug 'tpope/vim-fugitive'
Plug 'fatih/vim-go'
Plug 'scrooloose/syntastic'
Plug 'fatih/molokai'
Plug 'ctrlpvim/ctrlp.vim'

Mac install Nerd Font (Fire code)

brew cask
brew tap homebrew/cask-fonts 
brew install font-fira-code
brew install font-Fira-Code-nerd-font
brew install font-hack-nerd-font
@abdivasiyev
abdivasiyev / nerd_fonts.sh
Created December 24, 2022 20:16 — forked from davidteren/nerd_fonts.md
Install Nerd Fonts via Homebrew [updated & fixed]
# Nerd Fonts for your IDE
# https://www.nerdfonts.com/font-downloads
brew tap homebrew/cask-fonts && brew install --cask font-3270-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-fira-mono-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-go-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-lgc-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-monofur-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-overpass-nerd-font
@abdivasiyev
abdivasiyev / ternary.go
Created June 28, 2023 14:40
Simple ternary operator implementation in Go with generics
package ternary
type operatorIf[T comparable] struct {
condition bool
value T
elseIf *operatorIf[T]
elseValue T
}
func If[T comparable](condition bool) *operatorIf[T] {
@abdivasiyev
abdivasiyev / default.nix
Created February 3, 2024 18:37
default nix configuration
with import <nixpkgs> {}; rec {
helloNixEnv = stdenv.mkDerivation {
name = "hello-nix-env";
buildInputs = [ go ];
};
}