This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package textwidth | |
import ( | |
"unicode" | |
"golang.org/x/text/width" | |
) | |
// IsComb returns true if r is a Unicode combining character. Alias of: | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Rsync a git repository without .git directory, excluding files as per .gitignore | |
# -- as if, the target directory is a checkout without .git directory. | |
# | |
rsync -azP --delete --delete-excluded --filter=":- .gitignore" --exclude .git/ src/dir/path/ user@host:/dst/dir/path/ | |
# | |
# Rsync a git repository including the .git directory, excluding files as per | |
# .gitignore -- as if, the target directory is a clone. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following section enables users to execute arbitrary commands | |
# under Makefile environment. Users are expected run commands with | |
# 'make run' prefix. For example, | |
# | |
# $ make run go env | |
# | |
# Users can pass command-line options as follows: | |
# | |
# $ make run -- ls -l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"net" | |
"github.com/miekg/dns" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Save these rules in GNUmakefile in the configure.ac file directory. | |
# | |
# If user doesn't specify anything, pick a default docker image. | |
DOCKER_IMAGE ?= builder-ubuntu | |
# Bind mounts when running the docker image. Users can add more by defining | |
# DOCKER_BIND_OPTS in the command-line. | |
override DOCKER_BIND_OPTS += -v /home:/home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define defer_(x) do{}while(0); \ | |
auto void _dtor1_##x(); \ | |
auto void _dtor2_##x(); \ | |
int __attribute__((cleanup(_dtor2_##x))) _dtorV_##x=69; \ | |
void _dtor2_##x(){if(_dtorV_##x==42)return _dtor1_##x();};_dtorV_##x=42; \ | |
void _dtor1_##x() | |
#define defer__(x) defer_(x) | |
#define defer defer__(__COUNTER__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers | |
-------------------------- | |
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 | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
Read 4K randomly from SSD* 150,000 ns 0.15 ms |