Skip to content

Instantly share code, notes, and snippets.

@fengsp
fengsp / daemon.py
Created October 8, 2015 10:33
A simple daemon in Python
"""
daemon
~~~~~~
A simple daemon.
:copyright: (c) 2015 by Shipeng Feng.
:license: BSD.
"""
import os
@fengsp
fengsp / stream.py
Created October 28, 2014 11:19
Streaming data with Python and Flask
"""
stream
~~~~~~
Streaming data with Python and Flask.
:copyright: (c) 2014 by Shipeng Feng.
:license: BSD.
"""
import time
@fengsp
fengsp / main.rs
Created October 4, 2014 06:02
Rust generic and trait
fn main() {
println!("Hello, world!")
println!("{}", add(1i, 2i))
println!("{}", add(1.0f64, 2.0f64))
}
fn add<T: Add<T, T>>(x :T, y: T) -> T{
x + y
}