Skip to content

Instantly share code, notes, and snippets.

View kbrx93's full-sized avatar
✌️
RUNNING

kbrx93 kbrx93

✌️
RUNNING
View GitHub Profile
@kbrx93
kbrx93 / karabiner_capslock_control_tab.json
Created January 16, 2021 17:04 — forked from gxfxyz/karabiner_capslock_control_tab.json
Karabiner-Elements config: CapsLock / Control / Tab
{
"title": "CapsLock / Control / Tab",
"rules": [
{
"description": "Tap CapsLock (⇪) → Escape (⎋); Hold CapsLock (⇪) → Control (⌃)",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
@kbrx93
kbrx93 / karabiner_switch_input_source.json
Created January 16, 2021 17:01 — forked from gxfxyz/karabiner_switch_input_source.json
Karabiner-Elements config: switch input source | 输入法切换
{
"title": "Switch input source | 输入法切换",
"rules": [
{
"description": "Tap Command_L (⌘) → Switch input source to English | 短按左 Command (⌘) → 切换到英文输入法",
"manipulators": [
{
"conditions": [
{
"input_sources": [
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadContent</key>
<dict>
<key>com.google.Chrome</key>
@kbrx93
kbrx93 / MathJax based LaTeX plugin for TiddlyWiki 5.md
Last active January 16, 2019 06:03 — forked from kpe/ MathJax based LaTeX plugin for TiddlyWiki 5.md
MathJax based LaTeX plugin for TiddlyWiki 5

LaTeX plugin for TiddlyWiki 5 (based on MathJax)

(based on http://mathjax-tw5.kantorsite.net/)

To use with NodeJS create a plugins/mathjax/ directory in your wiki containing the two files (plugin.info and init.js), i.e.

plugins/
   mathjax/
      plugin.info
      init.js
tiddlers/
@kbrx93
kbrx93 / ssh.md
Created December 13, 2018 15:53 — forked from suziewong/ssh.md
SSH端口转发

ssh

    -C  压缩数据传输
    -f  后台登录用户名密码
    -N  不执行shell[与 -g 合用]
    -g  允许打开的端口让远程主机访问        
    -L  本地端口转发
    -R  远程端口转发

-p ssh 端口

@kbrx93
kbrx93 / TerminalVim.scpt
Created December 6, 2018 16:38 — forked from charlietran/TerminalVim.scpt
Open file in iTerm vim for MacOS Sierra 这个版本每个文件都是新窗口
-- TerminalVim.app
-- This creates a shim Application that will enable you to open files from the Finder in vim using iTerm
-- To use this script:
-- 1. Open Automator and create a new Application
-- 2. Add the "Run Applescript" action
-- 3. Paste this script into the Run Applescript section
-- 4. Save the application as TerminalVim.app in your Applications folder
-- 5. In the Finder, right click on a file and select "Open With". In that window you can set TerminalVim as a default
on run {input, parameters}
@kbrx93
kbrx93 / TerminalVim.scpt
Created December 6, 2018 15:59 — forked from MondoGao/TerminalVim.scpt
Open file in iTerm vim/neovim for MacOS High Sierra
-- TerminalVim.app
-- This creates a shim Application that will enable you to open files from the Finder in vim using iTerm
-- To use this script:
-- 1. Open Automator and create a new Application
-- 2. Add the "Run Applescript" action
-- 3. Paste this script into the Run Applescript section
-- 4. Save the application as TerminalVim.app in your Applications folder
-- 5. In the Finder, right click on a file and select "Open With". In that window you can set TerminalVim as a default
@kbrx93
kbrx93 / GetFilecharset.java
Created November 15, 2017 07:48 — forked from wcp1231/GetFilecharset.java
判断文件的编码类型
public static String getFilecharset(File sourceFile) {
String charset = "GBK";
byte[] first3Bytes = new byte[3];
try {
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(sourceFile));
bis.mark(0);
int read = bis.read(first3Bytes, 0, 3);
System.out.println("字节大小:"+read);
if (read == -1) {
return charset; //文件编码为 ANSI