Skip to content

Instantly share code, notes, and snippets.

@watsy0007
watsy0007 / periodic_worker.ex
Created October 15, 2022 16:49
elixir periodically
defmodule PeriodicWorker do
use GenServer
@impl true
def init(period_in_millis) do
# The `{:continue, :init}` tuple here instructs OTP to run `handle_continue`
# which in this case will fire the first `:do_stuff` message so the worker
# does its job once and then schedules itself to run again in the future.
# Without this you'd have to manually fire the message to the worker
# when your app starts.
@watsy0007
watsy0007 / doris_test.livemd
Created September 1, 2022 10:25
apache doris demo

Untitled notebook

Mix.install([
  {:kino_db, "~> 0.1.2"},
  {:myxql, github: "watsy0007/myxql", ref: "4510f6c", override: true}
])

Section

elixir livebook demo

Mix.install([
  {:websockex, "~> 0.4.3"},
  {:jason, "~> 1.3"},
  {:kino, "~> 0.6.2"},
  {:kino_vega_lite, "~> 0.1.3"},
  {:contex, "~> 0.4.0"}
])
@watsy0007
watsy0007 / yandex.livemd
Last active December 9, 2021 09:50
yandex livebook

yandex邮箱注册

安装依赖

Mix.install([
  # https://github.com/edgurgel/httpoison
  {:httpoison, "~> 1.8"},
  # https://github.com/devinus/poison
  {:poison, "~> 5.0"},
@watsy0007
watsy0007 / yandex 企业域名使用方案.md
Last active December 7, 2021 09:32
yandex 企业域名使用方案

web版登陆

  1. 登陆地址:https://mail.yandex.com/
  2. 输入对应的账号密码登陆

注意: 账号需要带上 @kingdata.com

注意:如果是俄文,可以通过切换,换成英文界面

登陆界面

  • 什么是Git?

    • 分布式 版本控制系统
  • Git的基础概念

    • 本地&远程

      • 本地 工作区与暂存区
        • git add
        • git commit
  • 远程
@watsy0007
watsy0007 / install.sh
Created February 18, 2020 06:53
aliyun rocket cpp library
wget -P /usr/local/lib https://ons-client-sdk.oss-cn-hangzhou.aliyuncs.com/cpp-rpm/darwin/librocketmq.dylib
wget -P /usr/local/lib https://ons-client-sdk.oss-cn-hangzhou.aliyuncs.com/cpp-rpm/darwin/librocketmq_client_core.dylib
wget -P /usr/local/include https://ons-client-sdk.oss-cn-hangzhou.aliyuncs.com/cpp-rpm/darwin/rocketmq.tar.gz
tar -xzf /usr/local/include/rocketmq.tar.gz -C /usr/local/include/
install_name_tool -id "@rpath/librocketmq_client_core.dylib" /usr/local/lib/librocketmq_client_core.dylib
@watsy0007
watsy0007 / Dockerfile
Created December 28, 2019 14:06
crystal smallest docker file
# FROM alpine:latest as builder
# RUN apk add -u crystal shards libc-dev
# WORKDIR /src
# COPY . .
# RUN crystal build --release src/api_demo.cr -o /src/api_demo
@watsy0007
watsy0007 / Dockerfile
Created December 26, 2019 03:14 — forked from entone/Dockerfile
FROM elixir:1.9.1-alpine as build
# # install build dependencies
RUN apk add --no-cache \
gcc \
g++ \
git \
make \
musl-dev
RUN mix do local.hex --force, local.rebar --force
@watsy0007
watsy0007 / baidu_news.md
Last active October 10, 2018 06:48
百度新闻爬虫
import requests
from bs4 import BeautifulSoup
from lxml import etree
import re
import html
import pprint
pp = pprint.PrettyPrinter(indent=4)

TAG_RE = re.compile(r'<[^>]+>')