content/HelloGitHub08.md
<p align="center"> </img> </p>兴趣是最好的老师,HelloGitHub 让你对开源感兴趣!
点击右上角的 「目录」 图标打开目录,获得更好的阅读体验。
Tips:如果遇到图片刷不出来的情况,点击 换一种浏览方式。
<p align="center"> </img>关注「HelloGitHub」公众号,第一时间收到推送
</p>以下为本期内容|每月 28 号更新
1、Newtonsoft.Json:Newtonsoft.Json 是一款 .NET 平台中开源的 JSON 序列化和反序列化类库,示例代码:
public class Account
{
public string Email { get; set; }
public bool Active { get; set; }
public DateTime CreatedDate { get; set; }
public IList<string> Roles { get; set; }
}
Account account = new Account
{
Email = "[email protected]",
Active = true,
CreatedDate = new DateTime(2013, 1, 20, 0, 0, 0, ateTimeKind.Utc),
Roles = new List<string>
{
"User",
"Admin"
}
};
string json = JsonConvert.SerializeObject(account, Formatting.Indented);
// {
// "Email": "[email protected]",
// "Active": true,
// "CreatedDate": "2013-01-20T00:00:00Z",
// "Roles": [
// "User",
// "Admin"
// ]
// }
Console.WriteLine(json);
2、libco:腾讯的开源项目——libco 是微信后台大规模使用的 C/C++ 协程库,2013 年至今稳定运行在微信后台的数万台机器上。
3、kcptun:也许是世界上最快的 UDP 传输工具,支持 macOS/Linux/Windows/FreeBSD/ARM/Raspberry Pi/OpenWrt。
<p align="center"></img></p>4、AndroidUtilCode:Android 开发人员不得不收集的代码,中文介绍
5、DanmakuFlameMaster:Bilibili 开源的 Android 开源弹幕引擎·烈焰弹幕使。特性:
6、atrament:极小的 JavaScript 画板,在线演示
<p align="center"></img></p>7、incubator-weex:移动端,跨平台前端框架,详细的中文档
8、httpstat:httpstat 美化了 curl 的结果,使得结果更加可读。同时它无依赖、兼容 Python3、一共才 300 多行。还可以显示 HTTP 请求的每个过程中消耗的时间,如下图:
9、PyMySQL:纯 Pyton 写的 MySQL 库,纯 Python 的好处就是可以运行在任何装有 Python 解释器(CPython、PyPy、IronPython)的平台上。相对于 MySQLdb 性能几乎一样,使用方法也一样,但是 PyMySQL 安装方法极其简单——pip install PyMySQL,PyMySQL 使用示例代码:
# 下面为例子需要的数据库的建表语句
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) COLLATE utf8_bin NOT NULL,
`password` varchar(255) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
AUTO_INCREMENT=1 ;
# -*- coding: utf-8 -*-
import pymysql.cursors
# 连接数据库
connection = pymysql.connect(host='localhost',
user='user',
password='passwd',
db='db',
charset='utf8mb4',
cursorclass=pymysql.cursors.DictCursor)
try:
with connection.cursor() as cursor:
# 创建一个新的纪录(record)
sql = "INSERT INTO `users` (`email`, `password`) VALUES (%s, %s)"
cursor.execute(sql, ('[email protected]', 'very-secret'))
# 连接不会自动提交,所以你想下面要调用 commit 方法,存储对数据库的改动
connection.commit()
with connection.cursor() as cursor:
sql = "SELECT `id`, `password` FROM `users` WHERE `email`=%s"
cursor.execute(sql, ('[email protected]',))
# 获取一条的纪录(record)
result = cursor.fetchone()
print(result) # 结果输出:{'password': 'very-secret', 'id': 1}
finally:
connection.close() # 操作完数据库一要记得调用 close 方法,关闭连接
10、reddit:reddit.com 网站的源码,通过这个项目,可以学习 Python 在构建大型项目中的使用、项目结构、代码风格、Python 技巧的使用方法等。安装教程
<p align="center"></img></p>11、discourse:Ruby 语言写的论坛,百分之百开源、免费。
<p align="center"></img></p>12、How-To-Ask-Questions-The-Smart-Way:提问的智慧,提出一个好的问题是解决问题的关键
13、jstraining:阮一峰写的全栈工程师培训材料
14、macOS-Security-and-Privacy-Guide:MacOS 的安全和隐私指南,中文翻译版
15、PTVS:Visual Studio 下的 Python 开发插件
16、styleguide:百度前端研发团队的文档与源码编写风格
17、the-swift-programming-language-in-chinese:中文版 Apple 官方 Swift 教程《The Swift Programming Language》
<p align="center"> <a href="https://github.com/521xueweihan/HelloGitHub/blob/master/content/HelloGitHub07.md">『上一期』</a> | <a href='https://github.com/521xueweihan/HelloGitHub/issues/899'>反馈和建议</a> | <a href="https://github.com/521xueweihan/HelloGitHub/blob/master/content/HelloGitHub09.md">『下一期』</a> </p>微信中搜:<strong>HelloGitHub</strong> 关注公众号
不仅能第一时间收到推送,还有回馈粉丝的活动
如果文中的图刷不出来,可以点击 <a href='https://hellogithub.com/periodical/volume/08'>这里</a>。
<sub>UCloud</sub>
<sub>超值的GPU云服务</sub>
</a>
</th>
<th align="center" style="width: 80px;">
<a href="https://www.upyun.com/?from=hellogithub">
<sub>CDN</sub>
<sub>开启全网加速</sub>
</a>
</th>
<th align="center" style="width: 80px;">
<a href="https://github.com/OpenIMSDK/Open-IM-Server">
<sub>OpenIM</sub>
<sub>开源IM力争No.1</sub>
</a>
</th>
<th align="center" style="width: 80px;">
<a href="https://www.qiniu.com/products/ai-token-api?utm_source=hello">
<sub>七牛云</sub>
<sub>百万 Token 免费体验</sub>
</a>
</th>
</tr>
<a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh"></a> 本作品采用 <a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh">署名-非商业性使用-禁止演绎 4.0 国际</a> 进行许可。