Skip to content

Instantly share code, notes, and snippets.

View clsung's full-sized avatar

Cheng-Lung Sung clsung

View GitHub Profile
@clsung
clsung / prometheus.yml
Created April 3, 2017 10:06
Prometheus on K8s
apiVersion: v1
kind : Service
metadata:
name: prometheus-svc
labels:
name: prometheus-svc
kubernetes.io/name: "Prometheus"
spec:
selector:
app: prometheus
FROM golang:1.8-alpine as builder
RUN apk update && apk upgrade && \
apk add --no-cache git
RUN go get -u sourcegraph.com/sourcegraph/appdash/cmd/...
FROM alpine:3.5
RUN apk --no-cache add ca-certificates
WORKDIR /
apiVersion: v1
kind : Service
metadata:
name: nginx
labels:
name: nginx-svc
kubernetes.io/name: "Nginx"
spec:
selector:
app: nginx
@clsung
clsung / README.md
Created November 18, 2017 10:58 — forked from arikfr/README.md
Redash Query Export Tool

Setup

$ pip install click requests

Usage

$ python query_export.py --redash-url "https://app.redash.io/" --api-key ""
@clsung
clsung / 词性标记.md
Created May 5, 2018 12:01 — forked from luw2007/词性标记.md
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性

词的分类

  • 实词:名词、动词、形容词、状态词、区别词、数词、量词、代词
  • 虚词:副词、介词、连词、助词、拟声词、叹词。

ICTPOS3.0词性标记集

n 名词

nr 人名

@clsung
clsung / deploy.sh
Created August 10, 2019 01:54
Cloud Run deploy
#!/usr/bin/env bash
# gcloud config set project {PROJECTID}
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
HOSTNAME=asia.gcr.io
PROJECTID=${GCP_PROJECT}
IMAGE=${IMAGE_NAME}
TAG=`git rev-parse --short=7 HEAD`
cd "${DIR}/.."
function handleImage(message, replyToken) {
axios.get(`https://api-data.line.me/v2/bot/message/${message.id}/content`, {
headers: {
'Authorization': `Bearer ${process.env.CHANNEL_ACCESS_TOKEN}`
}, responseType: 'stream'
}).then((res) => {
const tmp = tempfile();
const writer = fs.createWriteStream(tmp);
res.data.pipe(writer);
writer.on('finish', () => {