Postman

Request

headers
body

Presets

Collection

Export & Import

Environment

Mock

Test

1
2
3
4
5
6
pm.test("Response is Success", function () {
pm.response.to.have.status(200);
var jsonData = pm.response.json();
pm.expect(jsonData.success).to.eql(true);
pm.expect(jsonData.messageId).to.eql("10000");
});

Runner

Github Pages Vue 项目发布

使用Github Pages搭建Vue项目在线演示demo

分支:gh-pages
访问Url:https://[user_name].github.io/[project_name]
关键点:利用Github提供的静态页解析功能, 将静态页面推送到Github个人项目仓库的gh-pages分支下

在现有vue项目的基础上,执行以下步骤:

1
2
3
4
5
6
7
8
9
10
# 1.切换分支
git checkout gh-pages
# 2.构建项目,生成build文件
npm run build
# 3.强制添加dist文件夹,因为.gitignore文件中定义了忽略该文件
git add -f dist
# 4.提交
git commit -m 'Initial the page of project'
# 5.部署dist目录下的代码:使用git subtree命令可以在同一分支上维护源代码以及构建代码,在部署时仅仅推送dist目录下的内容
git subtree push --prefix dist origin gh-pages

提示:

在将Vue应用部署到gh-pages分支后,可能会出现部分资源无法加载的问题,原因就在于vue中的webpack配置在打包时其publicPath为根路径,如果该静态页在服务器中被访问则不会出现以上问题。在github解析时如果按照根路径解析会出错,因此在github上部署静态页时可以考虑将publicPath设置为当前目录,即 publicPath: ‘./‘。
同理,使用Vue-cli webpack模板生成的vue项目,出现上述问题应设置config/index.js中build对象下的assetsPublicPath字段为assetsPublicPath: ‘./‘,原理都是设置publicPath字段

Grafana

Time series

  • return column named time or time_sec (in UTC), as a unix time stamp or any sql native date data type. You can use the macros below.
  • return column(s) with numeric datatype as values
    Optional:
    • return column named metric to represent the series name.
    • If multiple value columns are returned the metric column is used as prefix.
    • If no column named metric is found the column name of the value column is used as series name
      Resultsets of time series queries need to be sorted by time.

时间选择

study

知识结构

1. 互联网

Java

数据库 MySQL

Redis

Elsaticsearch

MQ

基础 Git

架构 K8S

版本号

Git Subtree

推送指定文件夹到远程主机指定分支

1
git subtree push --prefix public origin master

public - 指定文件夹
master - 指定分支

Git cherry-pick 摘樱桃

cherry-pick,顾名思义:摘樱桃。如果说每一次commit是一颗樱桃,那么你可以通过cherry-pick命令将这一颗樱桃采摘到另外一颗樱桃树(branch)上。
命令:

1
git cherry-pick [--no-commit] 997367b(commit id)
  • –no-commit:预计可能会出现冲突的时候,建议这样用,以便先自查并解决冲突后再手动提交
  • commit id:可通过git log来查看,该命令执行后会把997367b这颗樱桃复制到当前分支并自动commit(如果没有冲突的话)

注意一点,cherry-pick产生的提交与原提交commit id不同

Git-查看代码提交次数

Git仓库代码提交次数:
git log –pretty=tformat: –numstat | awk ‘{ add += $1; subs += $2; loc += $1 - $2 } END { printf “added lines: %s, removed lines: %s, total lines: %s\n”, add, subs, loc }’ -

代码新增修改总计行数:
git log –pretty=tformat: –numstat | awk ‘{ add += $1; subs += $2; loc += $1 - $2 } END { printf “added lines: %s, removed lines: %s, total lines: %s\n”, add, subs, loc }’ -

hexo 博客部署

发布流程 - V2

  1. 安装hexo-deployer-git插件

    1
    npm install hexo-deployer-git --save
  2. 修改_config.yml配置

    1
    2
    3
    4
    5
    deploy:
    type: git
    repo: https://github.com/username/username.github.io.git
    branch: master
    message:
  3. 编译

    1
    hexo g
  4. 部署

    1
    hexo d

以上两步可以使用单条命令进行简化:

1
hexo g -d # 意为生成静态文件后立即部署网站
  1. 等待2min左右,页面展示。

V2流程中, 步骤1、2只需执行一次。

原理

当初次新建一个库的时候,库将自动包含一个master分支。请在这个分支下进行写作和各种配置来完善您的网页。当执行hexo deploy时,Hexo会创建或更新另外一个用于部署的分支,这个分支就是_config.yml配置文件中指定的分支。Hexo会将生成的站点文件推送至该分支下,并且完全覆盖该分支下的已有内容。因此,部署分支应当不同于写作分支。(一个推荐的方式是把master作为写作分支,另外使用public分支作为部署分支。)值得注意的是,hexo deploy并不会对本地或远程的写作分支进行任何操作,因此依旧需要手动推送写作分支的所有改动以实现版本控制。此外,如果您的Github Pages需要使用CNAME文件自定义域名,请将CNAME文件置于写作分支的source_dir目录下,只有这样hexo deploy才能将CNAME文件一并推送至部署分支。

发布流程 - V1

  1. 编译:hexo g
  2. src分支代码提交
  3. xshell同步到阿里云服务器
  4. 服务器端git提交
  5. 等待2min左右,页面展示

hexo 博客搭建

安装

node

node -v
npm -v

git

git version

github

个人仓库
username.github.io

hexo

1
2
npm install -g hexo-cli
hexo version

创建

hexo 命令

hexo version

显示 Hexo 版本。

hexo init [folder]

新建网站。如果没有设置 folder ,Hexo 默认在目前的文件夹建立网站。

hexo g

生成静态文件。

1
2
hexo generate
hexo g

监控文件变动,实时编译

1
2
hexo generate --watch
hexo g -w

生成静态文件后立即部署网站

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×