Skip to content

Instantly share code, notes, and snippets.

View haya14busa's full-sized avatar
🐶

haya14busa haya14busa

🐶
View GitHub Profile
@haya14busa
haya14busa / inchlsearch.patch
Last active October 8, 2017 10:45
Vim inchlsearch
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 56697d51d..b52f16bf3 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -4175,7 +4175,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'highlight' option. This uses the "Search" highlight group by
default. Note that only the matching text is highlighted, any offsets
are not applied.
- See also: 'incsearch' and |:match|.
+ See also: 'incsearch', 'inchlsearch' and |:match|.
#!/bin/bash
# Delay before starting
DELAY=5
# Sound notification to let one know when recording is about to start (and ends)
beep() {
paplay /usr/share/sounds/ubuntu/stereo/message-new-instant.ogg &
}
@haya14busa
haya14busa / diff.patch
Created July 19, 2017 16:09
vimlparser diff
--- vim-jp/vim-vimlparser/autoload/vimlparser.vim 2017-07-19 15:49:59.859034000 +0000
+++ haya14busa/go-vimlparser/autoload/vimlparser.vim 2017-07-19 16:09:22.166189982 +0000
@@ -137,6 +137,7 @@
let s:NODE_CURLYNAMEPART = 90
let s:NODE_CURLYNAMEEXPR = 91
let s:NODE_LAMBDA = 92
+let s:NODE_PARENEXPR = 93
let s:TOKEN_EOF = 1
let s:TOKEN_EOL = 2
@haya14busa
haya14busa / gista-file
Created July 19, 2017 16:07
vimlparser diff
--- vim-jp/vim-vimlparser/autoload/vimlparser.vim 2017-07-19 15:49:59.859034000 +0000
+++ haya14busa/go-vimlparser/autoload/vimlparser.vim 2017-07-19 15:57:45.642696899 +0000
@@ -137,6 +137,7 @@
let s:NODE_CURLYNAMEPART = 90
let s:NODE_CURLYNAMEEXPR = 91
let s:NODE_LAMBDA = 92
+let s:NODE_PARENEXPR = 93
let s:TOKEN_EOF = 1
let s:TOKEN_EOL = 2
@haya14busa
haya14busa / ioreader_contain.go
Last active June 19, 2017 15:07
Contains for io.Reader
// https://play.golang.org/p/0CnyWvQ8rY
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"strings"
)
(function() {
function getGoogleCalendarEventID() {
var elm = document.querySelector('div.ep[data-eid]');
if (!elm) {
return;
}
var eid = elm.getAttribute('data-eid');
if (!eid) {
return;
}
command! -nargs=1 BikaBika call s:make_bikabika(<q-args>)
command! -nargs=0 BikaBikaStop call s:stop_bikabika()
highlight! BikaBika ctermbg=green guibg=green
let s:_bika = {}
function! s:make_bikabika(pattern) abort
if !empty(s:_bika)
call s:_bika.stop()
@haya14busa
haya14busa / benchcmp.txt
Created March 28, 2017 03:56
cap and append (old) vs len and assign by index
benchmark old ns/op new ns/op delta
BenchmarkCompileOnepass/^(?:(?:(?:.(?:$))?))$-4 5782 5759 -0.40%
BenchmarkCompileOnepass/^abcd$-4 4831 4974 +2.96%
BenchmarkCompileOnepass/^(?:(?:a{0,})*?)$-4 5616 5636 +0.36%
BenchmarkCompileOnepass/^(?:(?:a+)*)$-4 5239 5201 -0.73%
BenchmarkCompileOnepass/^(?:(?:a|(?:aa)))$-4 6576 6967 +5.95%
BenchmarkCompileOnepass/^(?:[^\s\S])$-4 4090 4100 +0.24%
BenchmarkCompileOnepass/^(?:(?:(?:a*)+))$-4 5520 5652 +2.39%
BenchmarkCompileOnepass/^[a-c]+$-4 4207 4214 +0.17%
BenchmarkCompileOnepass/^[a-c]*$-4 4606 4625 +0.41%
@haya14busa
haya14busa / bench_result.txt
Last active March 12, 2017 12:52
[nit] reduce alloc on commonHeader initialization
# go test -v -bench=. | prettybench
PASS
benchmark iter time/iter bytes alloc allocs
--------- ---- --------- ----------- ------
BenchmarkBefore-4 200000 7609.00 ns/op 4427 B/op 4 allocs/op
BenchmarkAfter-4 500000 3633.00 ns/op 2414 B/op 1 allocs/op
@haya14busa
haya14busa / .git_commit_msg.txt
Created March 1, 2017 15:56
Commit emoji convention
## Commit emoji convention
#
# | emoji | description |
# |--------------------|-----------------------------------------|
# | :memo: | Add comment or doc |
# | :gift: | New feature. |
# | :bug: | Bug fix |
# | :bomb: | Breaking compatibility. |