分类 技术记录 下的文章

分支开发

(dev)$: git checkout -b feature/test            # 从dev建立特性分支
(feature/test)$: blabla                         # 开发
(feature/test)$: git add test
(feature/test)$: git commit -m 'commit comment'
(dev)$: git merge feature/test --no-ff          # 把特性分支合并到dev

删除分支

$ git branch -d feature/test                    # 删除本地分支
$ git push origin --delete feature/test         # 删除远程分支

feat - 新功能 feature
fix - 修复 bug
docs - 文档注释
style - 代码格式(不影响代码运行的变动)
refactor - 重构、优化(既不增加新功能,也不是修复bug)
perf - 性能优化
test - 增加测试
chore - 构建过程或辅助工具的变动
revert - 回退
build - 打包

#! /bin/bash

for ip in $@; do
    curl "http://ip-api.com/json/$ip?lang=zh-CN&fields=query,country,city,isp"
    echo -e ""
done

另存为ip.sh,然后chmod u+x ip.sh,使用时ip.sh google.com即可。

如果想显示更全的信息,删除fields字段就行了,具体参数参考Api参数查询

知乎现在官方推的账号简直是让人辣眼睛,一天天的推的都是什么东西,还要付费才能看,付费看个鬼啊,现在随便编个故事都能卖钱了麽。

写了个油猴脚本,屏蔽一些官方账号发送的内容,需要先安装油猴才能使用。

脚本内容如下:

// ==UserScript==
// @name         知乎账号回答屏蔽工具
// @namespace    https://hmilyld.com/
// @version      0.1
// @description  屏蔽知乎盐选等账号
// @author       Hmilyld
// @match        https://www.zhihu.com/*
// @require      https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.min.js
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    //需要屏蔽的用户
    var users = [
        "盐选科普","故事档案局","盐选推荐","真实故事计划"
    ]

    if ($('#ProfileMain').length > 0) {
        new MutationObserver(function (mutations) {
            remove_item();
        }).observe(document.getElementById('ProfileMain'), {
            childList: true,
            subtree: true,
        })
    }

    if ($('#QuestionAnswers-answers').length > 0) {
        new MutationObserver(function (mutations) {
            remove_item();
        }).observe(document.getElementById('QuestionAnswers-answers'), {
            childList: true,
            subtree: true,
        })
    }

    function remove_item() {
        $.each(users, function (idx, item) {
            $("meta[content='" + item + "']").closest(".List-item").hide();
        })
    }

    remove_item();
})();

天天看到某人的帖子烦的不行,顺手写了个油猴的脚本,添加上指定人的href就可以了,只屏蔽帖子列表,帖子内容页的信息不会屏蔽。

// ==UserScript==
// @name         落伍发帖人屏蔽器
// @namespace    https://hmilyld.com/
// @version      0.1
// @description  根据发帖人屏蔽发帖人所发的帖子信息
// @author       Hmilyld
// @match        https://www.im286.net/forum-1-*.html
// @require      https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.min.js
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    //href替换为想屏蔽的人就行了,替换后直接看不到该人发送的任何帖子
    $("a[href='space-uid-****.html']").each(function(idx, dom){
        $(dom).closest("tbody").hide();
    });
})();