调试js事件小技巧
万人都要将火熄灭,我一人独将此火高高举起。——海子 分享一个js调试事件小技巧 123456789<!DOCTYPE html><html><head> <title>Event Monitor Trigger</title></head><body> <button id="myButton">Click Me</button></body></html> 这里一个按钮,啥都没有 我们运行一下,给它在chrome console里添加事监听 12// 先用选中元素光标选一下按钮,这样$0就会指向按钮monitorEvents($0) 这时候我们触发其任何事件都会有输出 针对某一事件的话就传入该事件 1monitorEvents($0, ["click"])
ubuntu输入法ibus
人生的旅程就是这样,用大把时间迷茫,在几个瞬间成长。——瑞卡斯 IBus 全称 Intelligent Input Bus是下一代输入法框架(或者说“平台”)。 项目现托管于 Google Code - https://code.google.com/p/ibus/ 此项目包含了世界多数语言的文字输入需求——由世界多个国家开发者维护。 https://wiki.ubuntu.org.cn/IBus 安裝IBus框架:在终端输入命令: 1sudo apt-get install ibus ibus-clutter ibus-gtk ibus-gtk3 ibus-qt4 启用IBus框架:在终端输入: 1im-switch -s ibus 重新启动X(也可以重启电脑) 安装拼音引擎:在终端输入: 1sudo apt-get install ibus-pinyin 设置ibus-pinyin,在终端输入: 1/usr/lib/ibus-pinyin/ibus-setup-pinyin 安装sunpinyin模块,在终端输入: 1sudo apt-get ...
批量分页
再也无需前思后想,一切岂非已然过往。——《且听风吟》 今天分享一个装一个分批分页,传入页码、分页条数,然后查询分页条数+1条数据,这里的+1是为了判断还有下一页数据,然后查询到后,再按照传入的lambda条件筛选,筛选完后的数据添加进集合,添加到集合后如果满足当前分页所需条数,就返回数据 这里需要做一个容错,当时间超过后直接返回,避免传入的lambda predicate一直为false导致死循环 12345678910111213141516171819202122232425262728293031323334353637383940414243444546import com.baomidou.mybatisplus.extension.plugins.pagination.Page;import lombok.experimental.UtilityClass;import org.dromara.streamquery.stream.core.stream.Steam;import java.util.ArrayList;import java.util.List;...
file获取路径区别
男人勤劳家才富,女人节俭纱成布——佚名 这里 12345678910111213import java.io.File;class Scratch { public static void main(String[] args) throws Exception { File file = new File("../scratch.java"); String path = file.getPath(); String absolutePath = file.getAbsolutePath(); String canonicalPath = file.getCanonicalPath(); System.out.println("path:" + path); System.out.println("absolutePath:" + absolutePath); System.out.print...
spring-gateway跨域坑
没有不可认识的东西,我们只能说还有尚未被认识的东西。——高尔基 今天发现一个问题,前端跨域,这个我已经解决无数次了,但上了个网关,还是踩坑了 首先是网关配置了跨域 12345678910@Beanpublic CorsWebFilter corsFilter() { CorsConfiguration config = new CorsConfiguration(); config.addAllowedOriginPattern("*"); config.addAllowedHeader("*"); config.addAllowedMethod("*"); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", config); return new CorsWe...
spring注解排除某些bean
劳动是唯一导向知识的道路。——萧伯纳 使用: 12@ComponentScan(excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = {WillExludeBean.class, AnotherWillExludeBean.class})}) 即可 这里还有其他的过滤类型 例如注解 123@ComponentScan(excludeFilters = @Filter( type = FilterType.ANNOTATION, value = Service.class)) 切面 123@ComponentScan(includeFilters = @Filter( type = FilterType.ASPECTJ, pattern = "com.example..*Service+")) 正则 123@ComponentScan(includeFilters ...
alipay密钥工具生成证书
家庭关系的和睦依赖于各方履行自己的义务。——雪莱 分享一下支付宝支付生成密钥 首先是下载密钥工具 小程序文档 - 支付宝文档中心 然后是生成 接下来上传即可
docker运行seata
怀疑一切与信任一切是同样的错误,能得乎其中方为正道。——乔叟 https://hub.docker.com/r/seataio/seata-server 命令: 1docker run --name seata-server -p 8091:8091 -p 7091:7091 seataio/seata-server:latest 自定义配置文件: 123456docker run --name seata-server \ -p 8091:8091 \ -p 7091:7091 \ -e SEATA_CONFIG_NAME=file:/root/seata-config/registry \ -v /PATH/TO/CONFIG_FILE:/root/seata-config \ seataio/seata-server 指定ip 12345docker run --name seata-server \ -p 8091:8091 \ -p 7091:7091 \ ...
android毛玻璃效果
恭维不会使女人飘然,却往往使男人丧志。——王尔德 安卓实现一个毛玻璃效果可以使用Blurry https://github.com/wasabeef/Blurry 代码: 1234567// 覆盖,父级必须是 ViewGroupBlurry.with(context).radius(25).sampling(2).onto(rootView)// 添加// from ViewBlurry.with(context).capture(view).into(imageView)// from Bitmap Blurry.with(context).from(bitmap).into(imageView) Blur Options 模糊选项 Radius 半径 Down Sampling 下采样 Color Filter 彩色滤光片 Asynchronous Support 异步支持 Animation (Overlay Only)动画(仅限叠加) 1234567Blurry.with(context) .radius(10) .sampling(8) .color...
spring-state-machine持久化restore踩坑
没有人事先了解自己到底有多大的力量,直到他试过以后才知道。——歌德 今天遇到的问题是在响应式编程中发生禁止block异常: 1org.springframework.statemachine.persist.AbstractStateMachinePersister#restore 源码如下: 12345678@Overridepublic final StateMachine<S, E> restore(StateMachine<S, E> stateMachine, T contextObj) throws Exception { final StateMachineContext<S, E> context = stateMachinePersist.read(contextObj); stateMachine.stopReactively().block(); stateMachine.getStateMachineAccessor().doWithAllRegions(function -> function.r...
