Skip to content

Instantly share code, notes, and snippets.

💭
🐶

haya14busa haya14busa

💭
🐶
Block or report user

Report or block haya14busa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View getGoogleCalendarEventID.js
(function() {
function getGoogleCalendarEventID() {
var elm = document.querySelector('div.ep[data-eid]');
if (!elm) {
return;
}
var eid = elm.getAttribute('data-eid');
if (!eid) {
return;
}
View 2017-04-15-131418.vim
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 Mar 28, 2017
cap and append (old) vs len and assign by index
View benchcmp.txt
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 Mar 12, 2017
[nit] reduce alloc on commonHeader initialization
View bench_result.txt
# 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 Mar 1, 2017
Commit emoji convention
View .git_commit_msg.txt
## Commit emoji convention
#
# | emoji | description |
# |--------------------|-----------------------------------------|
# | :memo: | Add comment or doc |
# | :gift: | New feature. |
# | :bug: | Bug fix |
# | :bomb: | Breaking compatibility. |
View 2017-02-16-042524.go
package main
import (
"testing"
"github.com/kylelemons/godebug/pretty"
)
type ShipManifest struct {
Name string
@haya14busa
haya14busa / patch.diff
Created Feb 4, 2017
ignore missing ','
View patch.diff
diff --git a/imports/imports.go b/imports/imports.go
index 67573f4..32db0ca 100644
--- a/imports/imports.go
+++ b/imports/imports.go
@@ -124,6 +124,11 @@ func parse(fset *token.FileSet, filename string, src []byte, opt *Options) (*ast
if err == nil {
return file, nil, nil
}
+
+ if err != nil && strings.Contains(err.Error(), "missing ',' before newline in composite literal") {
@haya14busa
haya14busa / 2017-01-28-193616.go
Last active Jan 30, 2017
gerrit CommentInput test
View 2017-01-28-193616.go
package main
import (
"context"
"fmt"
"log"
"golang.org/x/build/gerrit"
)
@haya14busa
haya14busa / lint-throw.go
Last active Jan 14, 2017
linter for throw usage in vital.vim
View lint-throw.go
package main
import (
"bytes"
"flag"
"fmt"
"io"
"os"
"strings"
@haya14busa
haya14busa / create_review.go
Created Jan 4, 2017
testing GitHub review API
View create_review.go
package main
import (
"fmt"
"log"
"os"
"github.com/google/go-github/github"
"golang.org/x/oauth2"
)
You can’t perform that action at this time.