Skip to content

Instantly share code, notes, and snippets.

View tbswang's full-sized avatar
🎯
Focusing

tbswang tbswang

🎯
Focusing
View GitHub Profile
@tbswang
tbswang / mac-install.sh
Last active October 11, 2021 03:48
mac app install check list
# clashx
glados.rock
# ===================== shell ==========================
# homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# [oh my zsh ](https://ohmyz.sh/#install)
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@tbswang
tbswang / adapter.js
Created May 21, 2020 08:41
基于 jsonp 封装的 promise
// 以百度 api 为例
const getBmapInstance = baseURL => ({ url, params }) =>
new Promise((resolve, reject) => {
jsonp(baseURL + url + formatParams(params), null, (err, data) => {
if (err) {
reject(new Error('获取poi失败,请联系网站管理员'));
return;
}
if (data.status !== 0) {
reject(new Error('获取poi失败,请联系网站管理员'));