Write the Code. Change the World.

12月 27

相关问题

这里是客服相关的配置
api 配置入口:https://work.weixin.qq.com/api/doc/10514

加解密方案:https://work.weixin.qq.com/api/doc/90000/90139/90968#%E6%B6%88%E6%81%AF%E4%BD%93%E7%AD%BE%E5%90%8D%E6%A0%A1%E9%AA%8C

微信客服底部 api: https://work.weixin.qq.com/wework_admin/frame#/app/servicer

上传临时文件调用接口:
https://open.work.weixin.qq.com/wwopen/devtool/interface?doc_id=10112

各个语言实例: https://work.weixin.qq.com/api/doc/90000/90138/90307

这里是用户相关的配置

https://work.weixin.qq.com/wework_admin/frame#/customer/analysis

12月 16

mysql 计算距离并按距离远近升序排序

$latitude = 22.531162063479226;
$longitude = 113.954436585508;

$query = Model::query()->select(['latitude', 'longitude', 'address',]);

$query->where('latitude', '>', 0);

$query->addSelect(DB::raw("acos(cos(" . $latitude . "*pi()/180)*cos(latitude*pi()/180)*cos(" . $longitude . "*pi()/180-longitude*pi()/180)+sin(" . $latitude . "*pi()/180)*sin(latitude * pi()/180)) * 6367000 AS distance"));

$res = $query->orderBy('distance', 'asc')->get();

参考:

SELECT
    id,
    latitude,
    longitude,
    ROUND(
        6378.138 * 2 * ASIN(
            SQRT(
                POW(
                    SIN(
                        (
                            23.163292 * PI() / 180 - latitude * PI() / 180
                        ) / 2
                    ),
                    2
                ) + COS(23.163292 * PI() / 180) * COS(latitude * PI() / 180) * POW(
                    SIN(
                        (
                            113.3114676 * PI() / 180 - longitude * PI() / 180
                        ) / 2
                    ),
                    2
                )
            )
        ) * 1000
    ) AS distance
FROM
    cw_party
ORDER BY
    distance asc
12月 09

mac lightroom 遇到了用户权限问题Lightroom 问题。可以这样操作

# 新建一个 ps.sh 文件,写入以下脚本

#!/bin/bash
# reclaim Inactive memory due to memory leaks by Jenkins

echo === `date`

id=`id -u -nr`

home=/Users/$id

declare -a arr=( "Documents/Adobe/" "Library/Preferences/Adobe/" "Library/Caches/Adobe/" "Library/Application Support/Adobe/" )

for i in "${arr[@]}"
do
   echo "----------------------------------"
   echo "Process folder: $home/$i"

   echo "Restore owner: sudo chown -R $id $home/$i"
   sudo chown -R $id "$home/$i"

   echo "Restore read/write permission: chmod -RL +rwX $home/$i"
   chmod -RL +rwX "$home/$i"

   echo "Remove ACL: chmod -RN $home/$i"
   chmod -RN "$home/$i"
done

# 然后执行它
bash ps.sh 
12月 02

web 页面自适应处理。 其实,要说的是移动端网页自适应。只要设计图宽度标准化(有固定宽度,一般是 750px 宽度为标准),就方便实现整个页面的自适应。
继续阅读