Skip to content

Instantly share code, notes, and snippets.

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
[[plugins]]
repo = 'Shougo/dein.vim'
[[plugins]]
repo = 'Shougo/vimproc.vim'
build = 'make'
[[plugins]]
repo = 'tpope/vim-fugitive.git'
name: Publish hugo blog
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
@knsh14
knsh14 / kubernetes-basic-commands.md
Created June 21, 2018 19:59
kubernetes 勉強ログ

概要

  • node の中に pod がある
  • deployment
    • アプリケーションについての情報を持っている
  • service
    • deployment が外からアクセスを受けるためのワンクッション

コマンド 全部に kubectl がつくよ

確認コマンド

get

概要を確認する

package main
import (
"bytes"
"fmt"
"strings"
"testing"
)
func BenchmarkBytesBufferString(b *testing.B) {
@knsh14
knsh14 / result.txt
Created February 19, 2018 18:05
golang 1.10.0 strings.Builder benchmark
goos: linux
goarch: amd64
pkg: github.com/knsh14/sample
BenchmarkBytesBufferString/10-2 100000 12086 ns/op 1984 B/op 13 allocs/op
BenchmarkBytesBufferString/50-2 100000 17160 ns/op 7744 B/op 53 allocs/op
BenchmarkBytesBufferString/100-2 100000 24451 ns/op 14944 B/op 103 allocs/op
BenchmarkBytesBufferString/200-2 50000 30369 ns/op 29344 B/op 203 allocs/op
BenchmarkBytesBufferString/500-2 30000 56428 ns/op 72544 B/op 503 allocs/op
BenchmarkStringsBuilderString/10-2 200000 9501 ns/op 256 B/op 5 allocs/op
BenchmarkStringsBuilderString/50-2 200000 8830 ns/op 256 B/op 5 allocs/op
@knsh14
knsh14 / result.txt
Created February 6, 2018 09:10
golang 1.10 strings builder test
$ go test -bench . -benchmem
goos: linux
goarch: amd64
pkg: github.com/knsh14/sample
BenchmarkBytesBuffer-2 10 103512777 ns/op 438779214 B/op 23 allocs/op
BenchmarkStringBuilder-2 10 138950789 ns/op 661977072 B/op 54 allocs/op
BenchmarkBytesBufferString-2 5000000 353 ns/op 1280 B/op 1 allocs/op
BenchmarkStringBuilderString-2 2000000000 0.33 ns/op 0 B/op 0 allocs/op
PASS
ok github.com/knsh14/sample 5.699s
# auto suggestions setting
bindkey '^f' autosuggest-accept
if zplug check "zsh-users/zsh-history-substring-search"; then
bindkey '^P' history-substring-search-up
bindkey '^N' history-substring-search-down
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
fi
@knsh14
knsh14 / content.md
Created August 18, 2016 01:42
golang/go CodeReviewComments 日本語翻訳

Go Code Review Comments

原文

go fmt

あなたのコードに gofmt を走らせると、自動的に機械的に直すことのできるスタイルの大部分を修正してくれます。 世にあるGolang コードのほとんどすべてが gofmt を使っています。 この文章の残りは機械的に直すことのできないポイントについて解説します。

代わりに goimports を使う手段もあります。

@knsh14
knsh14 / basic.sh
Last active August 11, 2016 18:14
zsh設定
export LANG=ja_JP.UTF-8
setopt nolistbeep
autoload -Uz compinit
compinit
bindkey -v
alias ls='ls -G'
alias ll='ls -alh'
alias la='ls -a'
export EDITOR=vim
bindkey "^P" history-beginning-search-backward-end