threeperson博客园 IT技术、互联网技术、Java技术分享

{"errcode":40001,"errmsg":"invalid credential

近日接入微信公众号,获取用户信息时提示invalid credential ``` {"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest hint: [9j.bJa08 ``` ```

threeperson threeperson 发布于 2018-04-13
git

windows git log 中文乱码

试试git --no-pager log 如果可以显示的话,把pager设置为more git config --global core.pager more

threeperson threeperson 发布于 2018-01-01

linux 文件磁盘占用大小查看

### 先查看磁盘使用情况 df -lh ### 进入对应磁盘挂在目录 du -h --max-depth=2 会显示当前目录下个目录的大小 发现可疑的目录后,逐层进入

threeperson threeperson 发布于 2017-12-20

mysql 保存特殊字符

### mysql 保存特殊字符 > 直接在mysql client 修改字符集不起作用 alter table xxx convert to character set utf8mb4 collate utf8mb4_bin;

threeperson threeperson 发布于 2017-12-01

hibernate-validation 快速认证

Validator validate时会逐个校验bean 中加了验证注解的字段,然后返回一个错误列表。 现实开发中,这样的验证未免有些浪费,当有一个验证不ok,就应该直接返回,既节省了时间, 也满足了验证需求。 Validator 事实上是支持快速验证失败的。只需要在构建Validator,开启fa

threeperson threeperson 发布于 2017-08-10

音乐素材

www.playonloop.com www.noiseforfun.com

threeperson threeperson 发布于 2017-06-20

IllegalStateException: Type handler was null on parameter mapping for proper

```` if (parameterMapping.typeHandler == null) { throw new IllegalStateException("Type handler was null on parameter mapping for property '" + paramet

threeperson threeperson 发布于 2017-04-01

golang build 静态资源

golang build 只会将.go打包到可执行文件中,但是静态文件不会被打入。 web网站肯定是有静态资源的例如css js 或者html文件。如果想build的包可以用, ##### 一种方式是将静态资源文件个可执行的二进制文件放在同一个目录,然后执行./execute_file #### 另

threeperson threeperson 发布于 2017-02-03

OpenSSL 生成证书签名

mac上生成证书签名步骤很繁琐,于是在网上搜了一下,发现一个在线生成证书签名的网址[https://www.digicert.com/easy-csr/openssl.htm?rid=115630](https://www.digicert.com/easy-csr/openssl.htm?rid=

threeperson threeperson 发布于 2016-11-03

maven build 加载本地jar

####添加依赖 ``` <dependency> <groupId>cn.xxx</groupId> <artifactId>xxx</artifactId> <version>1.5.3-SNAPSHOT</version> </dependency> ``` ####添加plugin ```

threeperson threeperson 发布于 2016-07-03
git

git export source code

git archive --format zip --output "./subject_contract.zip" master -0

threeperson threeperson 发布于 2016-06-01

spring jdbcTemplate 批量插入返回自增id

项目中一个业务场景包含两个相互依赖的批量插入,第二次批量插入依赖第一次批量插入数据的自增id。我们的工程依赖的spring jdbcTemplate,于是我就翻看了一下jdbcTemplate的源码,发现批量插入接口,只是单存的返回影响的列表,并没有实际意义。 ``` public int[] ba

threeperson threeperson 发布于 2016-03-22

给html代码块添加行号

[Threeperson](http://www.threeperson.com)代码块添加了行号,阅读代码更加清晰,这个也是为了方便后续的评论功能。代码行号样式并不是我写的,本人css资历有限,其实js也是弱的不行,不过拿来即用的本事还是有一点。闲话少说,上代码。 #### 1. 第一步引入pre

threeperson threeperson 发布于 2016-02-10

go error 枚举

golang没有提供枚举支持,但是枚举在一些业务场景中却是十分重要的。举个简单的例子:发表帖子,需要对帖子做一些校验。这时我们可能就需要定义一些异常变量,这些常量自然是维护在枚举中语意更强,使用更加灵活。下面我简单介绍一下threeperson异常枚举实现思路。 #### iota 给const绑定

threeperson threeperson 发布于 2015-12-01