https://github.com/jaiminpan/pg_jieba
先执行 pg_config
跟着安装,发送错误
-- The C compiler identification is GNU 5.4.0
use actix_service::{Service, Transform}; | |
use actix_web::{dev::ServiceRequest, dev::ServiceResponse, Error}; | |
use futures::future::{ok, FutureResult}; | |
use futures::{Future, Poll}; | |
use slog::info; | |
// There are two step in middleware processing. | |
// 1. Middleware initialization, middleware factory get called with | |
// next service in chain as parameter. | |
// 2. Middleware's call method get called with normal request. |
package logger | |
import ( | |
"fmt" | |
"path" | |
"runtime" | |
"github.com/sirupsen/logrus" | |
) |
https://github.com/jaiminpan/pg_jieba
先执行 pg_config
跟着安装,发送错误
-- The C compiler identification is GNU 5.4.0
package main | |
import ( | |
"fmt" | |
"github.com/spf13/viper" | |
) | |
// Create private data struct to hold config options. | |
type config struct { |
''' | |
A python script which starts celery worker and auto reload it when any code change happens. | |
I did this because Celery worker's "--autoreload" option seems not working for a lot of people. | |
''' | |
import time | |
from watchdog.observers import Observer ##pip install watchdog | |
from watchdog.events import PatternMatchingEventHandler | |
import psutil ##pip install psutil | |
import os |
// Package GinHTMLRender provides some sugar for gin's template rendering | |
// | |
// This work is based on gin contribs multitemplate render https://github.com/gin-gonic/contrib/blob/master/renders/multitemplate | |
// | |
// Usage | |
// | |
// router := gin.Default() | |
// | |
// // Set html render options | |
// htmlRender := GinHTMLRender.New() |
package main | |
import ( | |
"flag" | |
"io" | |
"log" | |
"net" | |
"net/http" | |
"strings" | |
) |
My name is {{.Name}} and I'm {{.Age}} years old!! |
func handleUpload(u io.Reader) (err error) { | |
// capture all bytes from upload | |
b, err := ioutil.ReadAll(u) | |
if err != nil { | |
return | |
} | |
// wrap the bytes in a ReadSeeker | |
r := bytes.NewReader(b) |
sudo yum install libmpc-devel mpfr-devel gmp-devel | |
cd ~/Downloads | |
curl ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.2/gcc-4.9.2.tar.bz2 -O | |
tar xvfj gcc-4.9.2.tar.bz2 | |
cd gcc-4.9.2 | |
./configure --disable-multilib --enable-languages=c,c++ | |
make -j 4 | |
make install |