Skip to content

Instantly share code, notes, and snippets.

View ChinaXing's full-sized avatar
🤣
I may be slow to respond.

chinaxing ChinaXing

🤣
I may be slow to respond.
View GitHub Profile
@kraih
kraih / c10k.pl
Last active March 20, 2021 14:33
#
# Open 10k concurrent WebSocket connections with the client and server running
# in the same process and perform 10k WebSocket message roundtrips
#
# Tested on OS X 10.9.2 (MacBook Air) with Perl 5.18.2 and EV 4.17 (kqueue)
#
# 560.9MB memory usage, 0% CPU usage once roundtrips are finished after 36s
# (with all 20k sockets still open)
#
# Get the latest version of Mojolicious from http://github.com/kraih/mojo
@kraih
kraih / mango_app.pl
Last active December 12, 2015 10:09
use Mojolicious::Lite;
use Mango;
use Mango::BSON ':bson';
my $uri = 'mongodb://<user>:<pass>@<server>/<database>';
helper mango => sub { state $mango = Mango->new($uri) };
# Store and retrieve information non-blocking
get '/' => sub {
my $self = shift;
@AndreasVoellmy
AndreasVoellmy / epoll-example-pipe.c
Created October 16, 2012 17:30
epoll_ctl with EPOLLET on an already readable file
// compile with: gcc epoll-example-pipe.c
#include <stdio.h>
#include <stdlib.h>
#include <sys/epoll.h>
#define MAXEVENTS 64
int
main (int argc, char *argv[])
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

開源之道

Original transcript: http://allisonrandal.com/2012/04/15/open-source-enlightenment/

這幾年來,我慢慢覺得,我們參與開源社群,就像是在一條道路上並肩而行:這不僅讓我們成為更好的程式設計者,也讓我們通過與人合作,而成為更好的人。

您可以將它想成一條修行之道,讓身而為人的我們能夠不斷成長。接下來,我想談談我對開源世界的個人觀點,希望能與您分享。

首先,人是一切開源專案的核心。程式碼是很重要,但最核心的永遠是人。