Guillaume Papin(@Sarcasm) has a thorough article about compilation databases.
% mkdir build
% (cd build; cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=YES ..)
% ln -s build/compile_commands.json| ############################################################################### | |
| # Helpful Docker commands and code snippets | |
| ############################################################################### | |
| ### CONTAINERS ### | |
| docker stop $(docker ps -a -q) #stop ALL containers | |
| docker rm -f $(docker ps -a -q) # remove ALL containers | |
| docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter | |
| # exec into container |
Guillaume Papin(@Sarcasm) has a thorough article about compilation databases.
% mkdir build
% (cd build; cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=YES ..)
% ln -s build/compile_commands.jsonInstall Docker CE and nftables:
| 针对小容量mac book扩容的解决方案 | |
| 需要购买: | |
| 1.nvme硬盘盒 | |
| 2.大容量 nvme固态硬盘(推荐500G以上容量) | |
| 推荐下面这种侧插式nvme硬盘盒,完美匹配mac book,速度是10Gb/s,而且关机也不用取下。 | |
| 缺点是要占用一边两个雷电接口,硬盘盒自带一个充电接口, | |
| 算下来其实还好,不充电的情况下,多占了一个雷电接口。 |
| // NOTE | |
| // This gist was created long time ago. | |
| // According to zap's doc, now we can use zapcore.AddSync to directly add lumberjack as a zap sync | |
| // see https://github.com/uber-go/zap/blob/master/FAQ.md#does-zap-support-log-rotation | |
| // So I wrote a new gist if anyone is interested: | |
| // https://gist.github.com/rnyrnyrny/a6dc926ae11951b753ecd66c00695397 | |
| // thanks to: | |
| // https://studygolang.com/articles/17394 | |
| // https://stackoverflow.com/questions/54395407/zap-logging-with-1-customized-config-and-2-lumberjack |
| {"lastUpload":"2020-05-06T09:29:01.600Z","extensionVersion":"v3.4.3"} |
| all: txtfile | |
| TARGET_DIR = target-dir | |
| txtfile: $(TARGET_DIR) | |
| touch $(TARGET_DIR)/file.txt | |
| target-dir: | |
| test ! -d $(TARGET_DIR) && mkdir $(TARGET_DIR) |
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" | |
| "time" |