Skip to content

Instantly share code, notes, and snippets.

@nikgalushko
nikgalushko / code.go
Created April 2, 2026 20:03
test gemma-4-31b
package ch
import (
"os"
"sync"
"time"
)
// CH defines the interface for the buffered writer.
type CH interface {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
# Получаем текущую дату
TODAY=$(date +%Y-%m-%d)
# Получаем email текущего пользователя из git config
USER_EMAIL=$(git config user.email)
USER_NAME=$(git config user.name)
if [ -z "$USER_EMAIL" ]; then
@nikgalushko
nikgalushko / main.go
Created May 10, 2024 11:48
gocrew3 sqlite
package main
import (
"database/sql"
"fmt"
"math/rand"
"os"
"path/filepath"
"time"
@nikgalushko
nikgalushko / guide.md
Created November 4, 2021 13:13
7 steps to configure local system for playing with Golang generics before go 1.18

Install gotip

go install golang.org/dl/gotip@latest
gotip download

Install latest gopls

mkdir /tmp/gopls && cd "$_"
gotip mod init gopls-unstable
@nikgalushko
nikgalushko / git-stats.sh
Created August 12, 2020 06:44
git-stats
for name in $(git log --pretty="%ae%n%cn" | sort | uniq); do
git log \
--author "$name" \
--pretty=tformat: --numstat |
awk -v name="$name" '{
add += $1; subs += $2; loc += $1 - $2
} END {
if (loc != 0)
printf "[%s] Lines: +\033[32m%s\033[0m -\033[31m%s\033[0m; Total: %s\n", name, add, subs, loc
}'
call plug#begin('~/.vim/plugged')
Plug 'fatih/vim-go'
Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}
Plug 'preservim/nerdtree'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'tpope/vim-fugitive'
Plug 'morhetz/gruvbox'
Plug 'NLKNguyen/papercolor-theme'
lexicographical_compare(
// ... все символы строки l ...
begin(l), end(l),
// ... со всеми символами строки r ...
begin(r), end(r),
// ..., используя в качестве компаратора сравнение отдельных символов без учёта регистра
[](char cl, char cr) { return tolower(cl) < tolower(cr); }
);
@nikgalushko
nikgalushko / signal.go
Created February 18, 2020 06:48 — forked from reiki4040/signal.go
signal handling example for golang
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
)
func main() {
@nikgalushko
nikgalushko / squash.txt
Last active February 18, 2019 07:46
Squash all commits in branch
git checkout yourBranch
git reset $(git merge-base master yourBranch)
git add -A
git commit -m "one commit on yourBranch"