Skip to content

Instantly share code, notes, and snippets.

View ryanchentw's full-sized avatar

Ryan ryanchentw

  • Taiwan
View GitHub Profile
two tasks:
1. install skill: `npx skills add https://github.com/andrewyng/context-hub --skill get-api-docs -a opencode -g -y`
2. install chub: `npm install -g @aisuite/chub`
@ryanchentw
ryanchentw / ptt_ip_location.py
Last active July 28, 2018 06:19
嘗試查一下 ptt 推文網友的地區分佈,使用 maxmind geolite2
# -*- coding: utf-8 -*-
from lxml import etree
import geoip2.database
import requests
GEOIP = {
'country': geoip2.database.Reader('GeoLite2-Country.mmdb'),
'city': geoip2.database.Reader('GeoLite2-City.mmdb'),
}
from __future__ import unicode_literals
def test2():
assert '100分' == EMOJI_RE.sub('', '💯100分')
def test_full():
assert '' == EMOJI_RE.sub('', '😀')
ZSH_THEME_GIT_PROMPT_PREFIX="("
ZSH_THEME_GIT_PROMPT_SUFFIX=")"
ZSH_THEME_GIT_PROMPT_DIRTY=" ✗"
ZSH_THEME_GIT_PROMPT_CLEAN=" ✔"
PROMPT='%m %{$FG[010]%}%~%{$FG[208]%} $(git_prompt_info)%{$reset_color%] '
RPROMPT=" %{$fg[green]%}%(1j.%j.)%{$reset_color%}"