macos 安装 composer

https://getcomposer.org/download/ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');" 执行完以上命令会将composer安装到当前目录,然后再将composer拷贝到bin目录 mv composer.phar /usr/local/bin/composer

2019-11-25

homebrew 更换国内源

homebrew默认官方源托管在github上,国内访问奇慢无比,可更换成中科大或者清华大学的镜像 中国科大替换命令 # 中国科大: # 替换brew.git: $ cd "$(brew --repo)" $ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git # 替换homebrew-core.git: $ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" $ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git # 替换homebrew-bottles: $ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile $ source ~/.bash_profile # 应用生效: $ brew update 清华大学替换命令 # 清华大学: # 替换brew.git: $ cd "$(brew --repo)" $ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git # 替换homebrew-core.git: $ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" $ git remote set-url origin https://mirrors....

2019-11-25

typecho后台js报错

Uncaught TypeError: Cannot read property ‘available’ of null 安装完typecho最新版本(1.1-17.10.30-release)后台js报错 看了下是检测版本请求返回空 在151行添加非空判断如下 if(!!o){ applyUpdate(o); cache.setItem('update', resp.responseText); }

2019-11-23

有用的网址

商品信息查询 http://www.gds.org.cn/ http://www.ancc.org.cn/Service/queryTools/internal.aspx

2019-10-24

maven学习笔记

常用命令 ## 安装到本地跳过测试 mvn install -Dmaven.test.skip=true

2019-10-09

git学习笔记

git覆盖本地代码 git fetch --all && git reset --hard origin/master && git pull

2019-10-08

js 代码收藏

![0823dd54564e9258dbbe38929382d158cdbf4ec7.jpg][1] js 颜色渐变 function GetColor(val,tt) { if(tt>1){ tt = tt-1; } var one = (255 + 255) / tt; var r = 0, g = 0, b = 0; if (val < tt/2) { r = (one * val); g = 255; } else if (val >= tt/2 && val < tt) { r = 255; g = 255 - ((val - tt/2) * one); } else { r = 255; } return 'rgb(' + r + ', ' + g + ', ' + b + ')'; } var ss = 'js获取渐变颜色,效果演示' for(var i=0;i<ss....

2019-09-26

nodejs 笔记

nvm 切换 node 版本 使用nvm list命令列出已安装nodejs版本,使用nvm use [版本号]切换版本 nvm list nvm use [version]

2019-09-26