scoop
因结婚而产生的爱,造出儿女;因友情而产生的爱,造就一个人。——培根 分享一个windows命令行安装工具scoop github地址:https://github.com/ScoopInstaller/scoop 官网:https://scoop.sh/ 安装方式: ctrl+R打开powershell 执行: 12> Set-ExecutionPolicy RemoteSigned -Scope CurrentUser # Optional: Needed to run a remote script the first time> irm get.scoop.sh | iex 稍等一会儿 然后报错了 今天的博客到此结束 我们多试几次 安装成功 搜索软件: 1scoop search mongo 当然你也可以在这里搜索:https://scoop.sh/#/apps 例如安装nodejs 12345678910PS C:\> scoop install nodejs ...
mp查询出来时间自动去掉秒
陷入经济困境的人,是最容易被利用的——加藤谛三 由于需求变动,原先存入为LocalDateTime的,现在需要精确到分,但保留数据库原有的数据 所以查询时,只精确到分,将秒去掉 我们使用typeHandler,将秒设置为00 首先添加@TableName(autoResultMap = true)然后添加@TableField(typeHandler = DeSecondHandler.class) 12345678910111213141516171819202122232425package com.ruben.simplestreamquery.pojo.po;import com.baomidou.mybatisplus.annotation.TableField;import com.baomidou.mybatisplus.annotation.TableName;import com.ruben.simplestreamquery.handler.DeSecondsHandler;import lombok.Data;import java.time.Local...
js发送通知
温和的对待,不会使敌人变成朋友——萨迪 文档:https://developer.mozilla.org/zh-CN/docs/Web/API/Notification https://developer.mozilla.org/zh-CN/docs/Web/API/notification/requestPermission 代码如下 1234567Notification.requestPermission().then((permission) => { // If the user accepts, let's create a notification if (permission === "granted") { const notification = new Notification("Hi there!"); // … } }); 效果: 完整代码: 1234567891011121314151...
pinia
天时不如地利,地利不如人和——孟子 分享一个Vuex的同类型vue状态管理框架:Pinia 中文文档:https://pinia.web3doc.top/ 它的Demo:https://stackblitz.com/github/piniajs/example-vue-3-vite?file=README.md 相比于Vuex:https://pinia.web3doc.top/introduction.html#%E4%B8%8E-vuex-%E7%9A%84%E6%AF%94%E8%BE%83 Pinia 提供了一个更简单的 API,具有更少的规范,提供了 Composition-API 风格的 API,最重要的是,在与 TypeScript 一起使用时具有可靠的类型推断支持。
rewriteBatchedStatements
从前的日色变得慢,车,马,邮件都慢,一生只够爱一个人。——木心 我们在使用mybatis进行批量更新时,可以在mysql的链接url处添加rewriteBatchedStatements=true提升效率. 文档:https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-connp-props-performance-extensions.html 1rewriteBatchedStatements Should the driver use multi-queries, regardless of the setting of ‘allowMultiQueries’, as well as rewriting of prepared statements for INSERT and REPLACE queries into multi-values clause statements when ‘executeBatch()’ is called? Notice that this might allow SQL...
kotlin泛型多个上界
善气迎人,亲如兄弟;恶气迎人,害于戈兵。——管子 java中,我们可以使用<T extends Comparable<? super T>, Serializable>来指定多个接口的泛型限制 kotlin中 对应的是上界 上界最常见的约束类型是与 Java 的 extends 关键字对应的 上界: 1fun <T : Comparable<T>> sort(list: List<T>) { …… } 冒号之后指定的类型是上界:只有 Comparable<T> 的子类型可以替代 T。 例如: 12sort(listOf(1, 2, 3)) // OK。Int 是 Comparable<Int> 的子类型sort(listOf(HashMap<Int, String>())) // 错误:HashMap<Int, String> 不是 Comparable<HashMap<Int, String>> 的子类型 默认的上界...
Tailer
这个世界上没有无用的齿轮,也只有齿轮本身能决定自己的用途。——《嫌疑犯X的献身》 分享一个小工具,Hutool里有一个Tailer文件跟随很好用 文档:https://hutool.cn/docs/#/core/IO/%E6%96%87%E4%BB%B6/%E6%96%87%E4%BB%B6%E8%B7%9F%E9%9A%8F-Tailer 由来有时候我们要启动一个线程实时“监控”文件的变化,比如有新内容写出到文件时,我们可以及时打印出来,这个功能非常类似于Linux下的tail -f命令。 使用12Tailer tailer = new Tailer(FileUtil.file("f:/test/test.log"), Tailer.CONSOLE_HANDLER, 2);tailer.start(); 其中Tailer.CONSOLE_HANDLER表示文件新增内容默认输出到控制台。 123456789101112/** * 命令行打印的行处理器 * * @author looly * @since 4.5.2 */public static c...
sh脚本执行完毕按任意键退出
人事关系在社会上是一种资本,若要它经久,就不得不节用。——列夫·托尔斯泰 只需要在sh脚本后面添加这一行: 1read -n 1 例如: 1234567891011121314151617nvm use 14cd ./node_modules/hexo-generator-json-content# 卸载新版本cnpm uni hexo-util# 安装 2.7版本cnpm i hexo-util@2.7cd ../../hexo cleangit add .git commit -m ":trollface:"git branch --set-upstream-to=origin/master mastergit pull --allow-unrelated-historiesgit pushhexo ghexo dread -n 1 效果:
neutrino-proxy
千万别先给人一番赞美,再立刻给他一顿批评——马克·吐温 分享一个内网穿透项目neutrino-proxy 中微子代理(neutrino-proxy)是一个基于netty的、开源的java内网穿透项目。遵循MIT许可,因此您可以对它进行复制、修改、传播并用于任何个人或商业行为。 演示:
hsqldb
平平静静地吃粗茶淡饭,胜于提心吊胆地吃大鱼大肉——伊索 分享一个数据库hsqldb 全名HyperSQL,官网:http://hsqldb.org/ HSQLDB - 100% Java Database,其最大特点是百分百Java的数据库 这里是它的文档:http://hsqldb.org/web/hsqlDocsFrame.html 当然我们spring-boot已有其依赖: 引入即可使用 12345<dependency> <groupId>org.hsqldb</groupId> <artifactId>hsqldb</artifactId> <scope>runtime</scope></dependency> 无序配置,直接在resources下新建schema.sql 123456789101112131415161718192021222324252627282930drop table if exists user_info;create t...
