黑胶唱片Rails,能抗能打

今天在Hacker New上看到了一篇称赞Raisl的文章Why Rails Still Matters。 原文用黑胶唱片做为引子,说明以rails为代表的老旧web技术是ok的,不比 新的Next.js之类差很多,大家的应用场景不同而已. ...

February 22, 2025 · datewu

nopCloser函数

update: ioutil逐渐被io 取代。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 package ioutil // import "io/ioutil" func NopCloser(r io.Reader) io.ReadCloser NopCloser returns a ReadCloser with a no-op Close method wrapping the provided Reader r. As of Go 1.16, this function simply calls io.NopCloser. package io // import "io" func NopCloser(r Reader) ReadCloser NopCloser returns a ReadCloser with a no-op Close method wrapping the provided Reader r. 最近使用baloo写集成测试,遇到了个需求, 在unmarshalrespones之后(或者之前)还要再输出一次response的纯文本格式供debug参考。 ...

April 17, 2019 · datewu

配置http selinux

今天在digitocean一台新申请的主机上部署web应用。部署完成,打开浏览器发现报错403。 部署的web应用很简单,后端用nginx做了反向代理,应该没啥大问题。 进一步打开chrome的console,发现对static file的访问报错403,还没到后端就已经报错了, 估计后面的 upstream socket也会报错。 ...

April 16, 2018 · datewu