Skip to content

Instantly share code, notes, and snippets.

Nozomu Kaneko knzm

Block or report user

Report or block knzm

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 bench_unroll.txt
$ go version
go version go1.12.5 darwin/amd64
$ go test -bench .
goos: darwin
goarch: amd64
BenchmarkContainsUint64-4 500000 2286 ns/op
BenchmarkContainsUint64Unroll2-4 1000000 1988 ns/op
BenchmarkContainsUint64Unroll4-4 1000000 1589 ns/op
BenchmarkContainsUint64Unroll8-4 1000000 1795 ns/op
PASS
@knzm
knzm / 00-README.md
Last active Jul 20, 2019
build tesserocr for Python 2.7 on Windows
View 00-README.md
@knzm
knzm / gist:149fdda292a03caa7a49498bcff4fdb2
Created May 4, 2019
Fix firefox's disabled extensions related to the certificate issue occured at May 4, 2019
View gist:149fdda292a03caa7a49498bcff4fdb2
cd ~/Library/Application Support/Firefox/Profiles/<profile folder>
mv extensions.json extensions.json-20190504
cat extensions.json-20190504 | jq '(.addons[] | select(.signedState == -1)) |= (.signedState = 1 | .active = true | .appDisabled = false)' > extensions.json
@knzm
knzm / gist:6447ffb745e21d97d16ff3460935d095
Last active Mar 12, 2019
Replace style.css in Jasper.app to fix broken layout
View gist:6447ffb745e21d97d16ff3460935d095
# install asar
npm install -g asar
# extract, patch, then pack
mkdir out
asar extract /Applications/Jasper.app/Contents/Resources/app.asar out/
cd out
curl -s https://patch-diff.githubusercontent.com/raw/jasperapp/jasper/pull/85.diff | patch -p1
cd ..
asar pack out app.asar
View gist:fca0a824178f0dd1ebff247e01c7c412
$ VIRTUALENV_VERSION=16.2.0 virtualenv .
Traceback (most recent call last):
File "/usr/bin/virtualenv", line 11, in <module>
sys.exit(main())
File "/usr/lib/python2.7/site-packages/virtualenv.py", line 704, in main
options, args = parser.parse_args()
File "/usr/lib/python2.7/optparse.py", line 1384, in parse_args
values = self.get_default_values()
File "/usr/lib/python2.7/site-packages/virtualenv.py", line 579, in get_default_values
return optparse.Values(defaults)
View example_pool_with_interrupt.go
package main
import (
"errors"
"fmt"
"log"
"math/rand"
"sync"
"time"
)
View gist:51af9d39dab6989bfca907f104e74613
docker image ls --format '{{.CreatedAt}}\t{{.ID}}\t{{.Size}}\t{{.Repository}}:{{.Tag}}' | sort -k4 -t $'\t'
View fade_out_fade_in.sh
#!/bin/sh
set -eu
input=$1
output=$2
time=$3
fade_out_duration=0.5
fade_in_duration=0.5
@knzm
knzm / main.go
Last active Aug 2, 2018 — forked from podhmo/main.go
View main.go
package main
import (
"fmt"
"sort"
)
func formatIntPtr(fmtstr, nilstr string, p *int) string {
if p == nil {
return nilstr
View userChrome.css
#titlebar-buttonbox {
display: block !important;
vertical-align: top !important;
}
.tabbrowser-arrowscrollbox scrollbox {
overflow: visible !important;
}
.tabbrowser-arrowscrollbox scrollbox > box {
display: block !important;
}
You can’t perform that action at this time.