Skip to content

Instantly share code, notes, and snippets.

@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"
@nikgalushko
nikgalushko / move-stashes.md
Created December 29, 2018 07:50 — forked from alexeds/move-stashes.md
Move your stashes from one repo to another

Move your stashes from one repo to another


This was useful for me when we created a new branch for a new major release, but were still working on our current version as well. I cloned our repo again and kept the new project on our new branch, but also wanted to get my stashes there.

Download your stashes

git stash show -p > patch

You'll have to specify your stash and name your file whatevery you want. Do this for as all your stashes, and you'll have patch files in your pwd.

'use strict';
const NODE_ENV = process.env.NODE_ENV || "development"; //переменная окружения нужная для переключения между dev/prod
const webpack = require('webpack');
module.exports = {
context: __dirname + "/frontend", //указывается root, где искать файлы для entry
entry: { //объект, когда несколько точек входа. строка, когда одна
home: "./home",
about: "./about",
// Поместите настраиваемые сочетания клавиш в этот файл, чтобы перезаписать клавиши по умолчанию.
[
{
"key": "shift+cmd+-",
"command": "editor.foldAll",
"when": "editorTextFocus"
},
{
"key": "cmd+k cmd+0",
"command": "-editor.foldAll",