brew uninstall --ignore-dependencies node icu4c
brew install node
This file contains hidden or 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
#!/bin/bash | |
# | |
# Author: bwangel<[email protected]> | |
# Date: Feb,10,2017 16:55 | |
for C in {0..255}; do | |
tput setaf $((255-${C})) | |
tput setab $C | |
echo -n "$C " | |
done |
This file contains hidden or 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
# use the latest ubuntu environment (18.04) available on travis | |
dist: bionic | |
language: go | |
# You don't need to test on very old versions of the Go compiler. It's the user's | |
# responsibility to keep their compiler up to date. | |
go: | |
- 1.16.x |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Author: bwangel<[email protected]> | |
# Date:Oct,10,2017 14:16 | |
LOG_FILE="./2017_10_10uwsgi-webapp.log" | |
echo "" | awk ' | |
END { | |
FMT = "%-33s\t%-5s\t%-15s%-10s\n" |
This file contains hidden or 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
$ git clone [email protected]:xxxxx/xxxx.git my-awesome-proj | |
Cloning into 'my-awesome-proj'... | |
ssh: connect to host github.com port 22: Connection timed out | |
fatal: Could not read from remote repository. | |
$ # This should also timeout | |
$ ssh -T [email protected] | |
ssh: connect to host github.com port 22: Connection timed out | |
$ # but this might work |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# Script to run UDP Server on 127.0.0.1:8126 | |
# This mocks statsd server for testing | |
import socket | |
UDP_IP_ADDRESS = "127.0.0.1" | |
UDP_PORT_NO = 8126 |
Go提供了我们便利的进行并发编程的工具、方法和同步原语,同时也提供给我们诸多的犯错的机会,也就是俗称的“坑”。即使是顶级Go开发的项目,比如Docker、Kubernetes、gRPC、etcd, 都是有经验丰富的Go开发专家锁开发,也踩过不少的并发的坑,而且依然源源不断的继续踩着,即便是标准库也是这样。
分析和总结并发编程中的陷阱,避免重复踩在别人的坑中,正式本次培训课的重要内容。只有深入了解并发原语的实现,全面了解它们的特性和限制场景,注意它们的局限和容易踩的坑,才能提高我们的并发编程的能力。通过了解和学习其他人的经验和贡献的项目和库,我们可以更好的扩展我们的视野,避免重复的造轮子,或者说我们可以制作更好的轮子。
语言的内存模型定义了对变量的读写的可见性,可以清晰而准确读写事件的happen before
关系。对于我们,可以很好地分析和编排goroutine的运行,避免数据的竞争和不一致的问题。
通过本次课程,你可以:
This file contains hidden or 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
[V=browser-hello.mp4] Hi, I'm Matthew from OpenResty Inc. In this video, I'll demonstrate how to implement a "hello world" HTTP interface using OpenResty. | |
First of all, we make sure we are using OpenResty's nginx. | |
[delay=0] $ export PATH=/usr/local/openresty/nginx/sbin:$PATH | |
$ which nginx | |
[S] It's usually in this path. | |
And then we go to the home directory. |
This file contains hidden or 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
import qrcode | |
from qrcode.util import * | |
def hack_put(self, num, length): | |
if num == 0: | |
num = 233 # make a fake length | |
for i in range(length): | |
self.put_bit(((num >> (length - i - 1)) & 1) == 1) | |
qrcode.util.BitBuffer.put = hack_put |
OlderNewer