As your keybase user run:
$ keybase bot token create > /tmp/bot-token
You'll get back a base64 token, like: 6C37sjCBgMNf06Z6oTgixIxHJpja8G-Qp
. This is your bot token that allows you to sign up bots.
COPY ( | |
WITH | |
-- Read the raw log line by line by abusing CSV parser | |
raw_log AS ( | |
FROM read_csv_auto('/tmp/log/access.log-20230904.gz', header=false, delim='\0') | |
) | |
, combined_log AS ( | |
SELECT regexp_extract(column0 | |
, '^(\S+) (\S+) (\S+) \[(.*?)\] "([A-Z]+?) (.*?) HTTP/(.*?)" (\d+) (\d+) "(.*?)" "(.*?)"$' | |
, [ 'ip', 'identity', 'userid', 'timestamp', 'method' |
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{ | |
default: Turndown | |
}, { | |
default: Readability | |
}]) => { | |
/* Optional vault name */ | |
const vault = ""; | |
/* Optional folder name such as "Clippings/" */ |
So we we're using an API which returns a JSON response. One of its attributes is a numeric key. Due to historical reasons we're now being served longer number (longs) so the server, which is not based on JavaScript, started returning long integers.
I had heard about issues like this but hadn't cross against a real use case before.
So what started happening on our JavaScript clients (browser and React Native alike) is that the primitive value we get back once we get the fetch json promise resolved is an overflown number.
JavaScript engines commonly have the symbol Number.MAX_SAFE_INTEGER
so one can retrieve the number above which problems start to appear (it is 9007199254740991
).
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
This is not an exhaustive list of all interfaces in Go's standard library.
I only list those I think are important.
Interfaces defined in frequently used packages (like io
, fmt
) are included.
Interfaces that have significant importance are also included.
All of the following information is based on go version go1.8.3 darwin/amd64
.
require "test_helper" | |
require "awesome_print" | |
require "hashdiff" | |
class MyClass | |
def self.do_stuff | |
{a:[{y:3}, {x:11, z:33}], b:{y:22}} | |
end | |
end |
Located in alphabetical order (not prefer)
C
ab
), also designed as a more modern replacement, written in C
golang
)Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
# It extends activeadmin to show pretty boolean values | |
# | |
# config/initializers/active_admin.rb | |
module ActiveAdmin | |
module Views | |
class TableFor | |
def bool_column(attribute) | |
column(attribute){ |model| model[attribute] ? '✔'.html_safe : '✗'.html_safe } | |
end |