下拉刷新
Catalog

HelloGitHub Vol.8

HelloGitHub shares interesting, beginner-friendly open-source projects from GitHub, updated every month on the 28th. Discover fun beginner projects, open-source books, practical tutorials, and enterprise-grade projects, helping you quickly experience and become interested in the charm of open source.

C#
Star 1.1w
9 years ago

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 = "james@example.com",
     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": "james@example.com",
//   "Active": true,
//   "CreatedDate": "2013-01-20T00:00:00Z",
//   "Roles": [
//     "User",
//     "Admin"
//   ]
// }

Console.WriteLine(json);
C++
2
libco
Star 8.6k
9 years ago

腾讯的开源项目——libco 是微信后台大规模使用的 C/C++ 协程库,2013 年至今稳定运行在微信后台的数万台机器上。

  • 无需侵入业务逻辑,把多进程、多线程服务改造成协程服务,并发能力得到百倍提升
  • 支持 CGI 框架,轻松构建 Web 服务
  • 支持 gethostbyname、mysqlclient、ssl 等常用第三方库
  • 可选的共享栈模式,单机轻松接入千万连接
  • 完善简洁的协程编程接口
    • 类 pthread 接口设计,通过 co_create、co_resume 等简单清晰接口即可完成协程的创建与恢复
    • __thread 的协程私有变量、协程间通信的协程信号量 co_signal
    • 语言级别的 lambda 实现,结合协程原地编写并执行后台异步任务
    • 基于 epoll/kqueue 实现的小而轻的网络框架,基于时间轮盘实现的高性能定时器
Go
3
kcptun
Star 1.4w
9 years ago

也许是世界上最快的 UDP 传输工具,支持 macOS/Linux/Windows/FreeBSD/ARM/Raspberry Pi/OpenWrt。

kcptun
Java
Star 3.4w
9 years ago

Android 开发人员不得不收集的代码,中文介绍

Star 9.6k
9 years ago

Bilibili 开源的 Android 开源弹幕引擎·烈焰弹幕使。特性:

  • 使用多种方式(View/SurfaceView/TextureView)实现高效绘制
  • 该站 XML 弹幕格式解析
  • 基础弹幕精确还原绘制
  • 支持 mode7 特殊弹幕
  • 多核机型优化,高效的预缓存机制
  • 支持多种显示效果选项实时切换
  • 实时弹幕显示支持
  • 换行弹幕支持/运动弹幕支持
  • 支持自定义字体
  • 支持多种弹幕参数设置
  • 支持多种方式的弹幕屏蔽
JavaScript
Star 1.7k
9 years ago

极小的 JavaScript 画板,在线演示

atrament
Star 1.4w
9 years ago

移动端,跨平台前端框架,详细的中文档

Python
Star 6.1k
9 years ago

httpstat 美化了 curl 的结果,使得结果更加可读。同时它无依赖、兼容 Python3、一共才 300 多行。还可以显示 HTTP 请求的每个过程中消耗的时间,如下图:

httpstat
Star 7.8k
9 years ago

纯 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, ('webmaster@python.org', 'very-secret'))

    # 连接不会自动提交,所以你想下面要调用 commit 方法,存储对数据库的改动
    connection.commit()

    with connection.cursor() as cursor:
        sql = "SELECT `id`, `password` FROM `users` WHERE `email`=%s"
        cursor.execute(sql, ('webmaster@python.org',))

        # 获取一条的纪录(record)
        result = cursor.fetchone()
        print(result)  # 结果输出:{'password': 'very-secret', 'id': 1}
finally:
    connection.close()  # 操作完数据库一要记得调用 close 方法,关闭连接
10
reddit
Star 1.7w
9 years ago

reddit.com 网站的源码,通过这个项目,可以学习 Python 在构建大型项目中的使用、项目结构、代码风格、Python 技巧的使用方法等。安装教程

reddit
Ruby
Star 4.5w
9 years ago

Ruby 语言写的论坛,百分之百开源、免费。

discourse
Other
Star 3.3w
9 years ago

提问的智慧,提出一个好的问题是解决问题的关键

Star 2w
9 years ago

阮一峰写的全栈工程师培训材料

Star 2.2w
9 years ago

MacOS 的安全和隐私指南,中文翻译版

15
PTVS
Star 2.6k
9 years ago

Visual Studio 下的 Python 开发插件

Star 2.5k
9 years ago

百度前端研发团队的文档与源码编写风格

Star 2.1w
9 years ago

中文版 Apple 官方 Swift 教程《The Swift Programming Language》

Catalog
  • C#
  • C++
  • Go
  • Java
  • JavaScript
  • Python
  • Ruby
  • Other