This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class UnitConvertUtil { | |
/** | |
* 文件大小 例如 1024 -> 1 MB | |
* | |
* @param {*} value | |
* @param {number} fix | |
* @param {string} [base] | |
* @returns | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function search(obj: Object, query: string) { | |
for (let key of Object.getOwnPropertyNames(obj)) { | |
if (RegExp(query, 'i').test(obj[key])) { | |
return true | |
} | |
} | |
return false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
case $# in | |
0) | |
echo "Usage: $0 {start|stop}" | |
exit 1 | |
;; | |
1) | |
case $1 in | |
start) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package utils | |
import ( | |
"bytes" | |
"encoding/binary" | |
"fmt" | |
"net" | |
"sort" | |
"strconv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
; Key Mappings | |
LCtrl::RCtrl | |
CapsLock::LCtrl | |
LAlt::LWin | |
LWin::LAlt | |
RAlt::~ | |
RCtrl::CapsLock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 重新加载配置 | |
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "R", function() | |
hs.reload() | |
end) | |
hs.alert.show("加载完毕") | |
-- 窗口横二竖二 | |
hs.hotkey.bind({"cmd", "ctrl"}, "a", function() | |
local win = hs.window.focusedWindow() |