byte-buddy
与有肝胆人共事,从无字句处读书。——周恩来 分享一个字节码框架,能在jvm运行时动态加载Class、修改Class 官方文档:https://bytebuddy.net/#/ github:https://github.com/raphw/byte-buddy.git 引入: 12345<dependency> <groupId>net.bytebuddy</groupId> <artifactId>byte-buddy</artifactId> <version>1.12.21</version></dependency> 一个简单的Hello World: 123456789Class<?> dynamicType = new ByteBuddy() .subclass(Object.class) .method(ElementMatchers.named("toString")) .intercept(FixedValue.va...
code runner
万人都要将火熄灭,我一人独将此火高高举起。——海子 分享一个插件:Code Runner可以直接运行代码,不需要复杂配置环境 安装以后可以直接运行当前文件 我们直接运行ts的话,还需要安装一个ts-node 1tyarn global add ts-node 运行代码: 12345678910111213141516171819class Student { fullName: string; constructor(firstName: string, middleInitial: string, lastName: string) { this.fullName = firstName + " " + middleInitial + " " + lastName; }}interface Person { firstName: string; lastName: string;}function greeter(person...
react新版api
我们飞得越高,我们在那些不能飞的人眼中的形象就越渺小。——尼采的《查拉图斯特拉如是说》 如果你是在react18这么写: 123456// index.tsximport React from 'react'import ReactDOM from 'react-dom'console.log('Hello from tsx!')ReactDOM.render(<p>Hello</p>, document.getElementById('root')) 你会得到一个错误 1react-dom.development.js:86 Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. L...
升级mp新版本后,service里removeByIds主键类型不一致报错
先谋后事者逸,先事后图者失。——陈子昂 场景: 主键类型是Integer,使用service中removeByIds,传入List<String>报错 MP用的mybatis的反射,只需要在表信息初始化后,获取反射的缓存map,往里面放入我们自定义的转换操作即可 代码如下: 12345678910111213141516171819202122232425262728293031323334353637383940414243import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;import com.baomidou.mybatisplus.core.metadata.TableInfo;import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;import io.github.vampireachao.stream.core.reflect.ReflectHelper;import io.github....
kotlin获取属性注解
微笑具有一种挽救力,它可以点亮天空,可以振作精神,可以改变你周围的气氛,更可以改变你——乔·吉拉德 kotlin里获取属性注解首先引入反射依赖: 1234<dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-reflect</artifactId></dependency> 完整: 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmln...
css渐变实现杂色
团结就是力量——毛泽东 思路出处:https://css-tricks.com/making-static-noise-from-a-weird-css-gradient-bug/ 这是一个通过css渐变产生的锯齿BUG实现的噪点效果 例如我们使用径向渐变画两个圆,这里用的径向渐变函数radial-gradient,其中第一个参数是距离中心点近的渐变样式,第二个是远一些的,每个参数中第一项是颜色,第二项是区域 这里的: 从中心点进行沿半径进行渐变 123456789101112131415<div class="box"></div><div class="box"></div><style> .box { display: inline-block; width: 300px; aspect-ratio: 1; margin: 10px; border: 2px solid red; background: radial-gradient(#000...
buttons
善人同处,则日闻嘉讯;恶人同游,则日生邪情。——范晔 分享一个按钮样式项目: https://github.com/alexwolfe/Buttons 对应的网站: https://unicorn-ui.com/buttons/builder/# 可以自定义你的按钮样式、颜色、点击效果 包括3d等等
transition.style
我这个人走得很慢,但是我从不后退。——亚伯拉罕·林肯 分享一个网站https://www.transition.style 这个网站提供了transition的各种css动画效果,其github地址:https://github.com/argyleink/transition.css 可以直接选取你需要的动画效果,点击复制,右边还可以自定义时间、淡入淡出等
lunar
人,现在最年轻啦。因为比起明天来,今天是年轻的。对于一个人来说,什么时候都是现在最年轻。──永六辅 lunar是一个支持阳历、阴历、佛历和道历的日历工具库,它开源免费,有多种开发语言的版本,不依赖第三方,支持阳历、阴历、佛历、道历、儒略日的相互转换,它能用来制作日历,甚至算命。 除此之外,还支持星座、干支、生肖、节气、节日、彭祖百忌、每日宜忌、吉神宜趋、凶煞宜忌、吉神方位、冲煞、纳音、星宿、八字、五行、十神、建除十二值星、青龙名堂等十二神、黄道日及吉凶等。 支持的时间跨度约为0001年至9999年。 地址:https://6tail.cn/calendar/api.html github: javascript:https://github.com/6tail/lunar-javascript java:https://github.com/6tail/lunar-java c#.net:https://github.com/6tail/lunar-csharp php(composer):https://github.com/6tail/lunar-php ph...
unocss
忍把浮名,换了浅斟低唱。——柳永《鹤冲天》 分享一个css框架unocss 可以通过class规则,生成对应样式,例如通过m-1生成margin: 0.25rem 而且规则可以通过 https://uno.antfu.me/ 进行查询 除了预制规则,还可以自定义规则: 123rules: [ ['m-1', { margin: '0.25rem' }],] 即可生成 1.m-1 { margin: 0.25rem; } 还可以通过正则的方式 1234rules: [ [/^m-(\d+)$/, ([, d]) => ({ margin: `${d / 4}rem` })], [/^p-(\d+)$/, match => ({ padding: `${match[1] / 4}rem` })],] 使用起来 123456<div class="m-100"> &...
