Skip to content

Instantly share code, notes, and snippets.

View hhstore's full-sized avatar
:octocat:
Focusing

Henry.H hhstore

:octocat:
Focusing
View GitHub Profile
@hhstore
hhstore / flutter-set-env
Last active July 8, 2021 02:17
set env for flutter and android
#######################################################
# for android:
#######################################################
# https://developer.android.com/studio/command-line/variables?hl=zh-cn
export ANDROID_SDK_ROOT="$HOME/sdk/android"
#
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator
export PATH=$PATH:$ANDROID_SDK_ROOT/tools
@hhstore
hhstore / Makefile
Last active April 24, 2019 03:01
golang IDE 配置: 镜像包管理工具
# 镜像安装被墙的包:
install.gopm:
go get -u github.com/gpmgo/gopm
# 镜像安装:
install.goland:
gopm get -u -v golang.org/x/tools/internal/fastwalk
gopm get -u -v golang.org/x/tools/internal/module
gopm get -u -v golang.org/x/tools/internal/gopathwalk
#
@hhstore
hhstore / file_server.go
Created April 18, 2019 02:13
go 静态资源 web 服务器
package main
import (
"log"
"net/http"
)
// 静态资源 web 服务器:
// - 适用纯静态资源的 docs 服务
// - 普通文件服务器: mp3/txt 等
@hhstore
hhstore / kafka_consumer.py
Created September 12, 2018 02:49
kafka: consumer
from kafka import KafkaConsumer, KafkaProducer
SERVERS = ['localhost:9092', ]
def consume():
c = KafkaConsumer("topic1", group_id='group1', bootstrap_servers=SERVERS)
for msg in c:
print("consume:", msg)
@hhstore
hhstore / kafka_producer.py
Created September 12, 2018 02:46
kafka: producer
from kafka import KafkaConsumer, KafkaProducer
# pip install kafka-python
SERVERS = ['localhost:9092', ]
def produce():
p = KafkaProducer(bootstrap_servers=SERVERS)