Skip to content

Instantly share code, notes, and snippets.

View yueyoum's full-sized avatar

Yueyoum yueyoum

  • Chengdu, China
View GitHub Profile
@yueyoum
yueyoum / xx
Created January 16, 2016 16:07
忘记地址,请发email索取:
getsisurl#gmail.com(#换成@)
@yueyoum
yueyoum / asio_reuseport.cpp
Created January 5, 2016 06:21
how to set SO_REUSEPORT flat with boost asio library
#include <iostream>
#include <string>
#include <array>
#include <boost/asio.hpp>
#include <arpa/inet.h>
using boost::asio::ip::tcp;
int main()
# -*- coding: utf-8 -*-
import arrow
import MySQLdb
db = MySQLdb.connect(
host='127.0.0.1',
port=3306,
user='root',
passwd='root',
#!/bin/bash
apt-get install build-essential
apt-get install libpcre3-dev
apt-get install libssl-dev
apt-get install libmysqld-dev
apt-get install libncurses5-dev
apt-get install libreadline-dev
apt-get install python-dev
apt-get install python-pip
#!/bin/bash
apt-get install build-essential
apt-get install libpcre3-dev
apt-get install libssl-dev
apt-get install python-dev
apt-get install libmysqld-dev
apt-get install libncurses5-dev
apt-get install libreadline-dev
apt-get install python-pip
#!/bin/bash
DAYS=3650
# example: http://svn.red-bean.com/repos/main/3bits/servercert_3bits.txt
# 1 Create a Certifying Authority (CA) keypair.
# ca.crt / ca.key
# a. generate key
syntax on
set nocompatible
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set cindent
set ignorecase
import gevent
from gevent.event import Event
from gevent import subprocess
from gevent import signal as gevent_signal
import os
import sys
import signal
-module(fibo).
-export([start/1]).
-vsn(1.1).
start(Num) ->
ResultList = start(Num, 0, []),
Result = lists:sum(ResultList),
io:format("~p~n", [ResultList]),
io:format("~p~n", [Result]),
ok.
@yueyoum
yueyoum / fib.py
Last active August 29, 2015 14:01
def fibo(n):
if n == 0:
return 0
x = [0, 1]
if n < 2:
return sum(x)
for i in range(2, n):
x.append( x[i-1] + x[i-2] )