Skip to content

Instantly share code, notes, and snippets.

@sunzsh
sunzsh / v-drag.js
Created December 1, 2022 13:43
v-drag指令
Vue.directive('drag', (el) => {
const oDiv = el // 当前元素
const minTop = oDiv.getAttribute('drag-min-top')
const ifMoveSizeArea = 20
oDiv.onmousedown = e => {
let target = oDiv
while (window.getComputedStyle(target).position !== 'absolute' && target !== document.body) {
target = target.parentElement
}
@sunzsh
sunzsh / 系统当前选中文件路径.applescript
Last active December 7, 2023 06:20
alfred获取当前选中的文件路径
on run
tell application "Finder" to set aliasItemName to selection as alias
set posixPathName to POSIX path of aliasItemName
return posixPathName
end run
"editor.renderFinalNewline": "dimmed",
"workbench.colorCustomizations": {
"editorLineNumber.foreground": "#222",
"editorLineNumber.activeForeground": "#666",
"editorLineNumber.dimmedForeground": "#111",
"editorIndentGuide.background": "#222",
"editorIndentGuide.activeBackground": "#666",
"editor.lineHighlightBackground": "#111", //修改光标所在行的背景色
"editor.lineHighlightBorder": "#333", //修改光标所在行的边框色
"editor.wordHighlightBorder": "#e4893995"
@sunzsh
sunzsh / fix-zoom.js
Created December 29, 2023 15:37
解决代码修改了网页zoom导致各种popover错位的问题(适配vue2+elementUI)
export default {
install(Vue) {
const delegates = {
'el-select': (component, element) => {
return [component.$refs.reference.$el]
},
'el-pagination': (component, element) => {
const sizesComponent = component.$children.find((child) => child.$options._componentTag === 'sizes');
const eles_ElSelectInSizes = delegates['el-select'](sizesComponent.$children[0], element);
@sunzsh
sunzsh / jar_run.bat
Created October 11, 2024 12:53
启动jar
set SERVER_ROOT=C:\Users\sunzsh\Desktop\simple_app
set JAR_NAME=simple.war
set JVM_XMS=64m
set JVM_XMX=384m
set JVM_XMN=32m
set JVM_MS=128m
set JVM_MMS=256m
set SPRING_PROFILE=
set JAVA_OPT=%JAVA_OPT% -server -Xms%JVM_XMS% -Xmx%JVM_XMX% -Xmn%JVM_XMN% -XX:MetaspaceSize=%JVM_MS% -XX:MaxMetaspaceSize=%JVM_MMS%