Skip to content

Instantly share code, notes, and snippets.

@xinhaoyuan
xinhaoyuan / qmk_separate_mk_acc.diff
Created October 7, 2023 18:47
QMK mouse key: separate x/y accelerations
diff --git a/quantum/mousekey.c b/quantum/mousekey.c
index df8aa613be..7e451c517a 100644
--- a/quantum/mousekey.c
+++ b/quantum/mousekey.c
@@ -35,7 +35,8 @@ static inline int8_t times_inv_sqrt2(int8_t x) {
static report_mouse_t mouse_report = {0};
static void mousekey_debug(void);
static uint8_t mousekey_accel = 0;
-static uint8_t mousekey_repeat = 0;
+static uint8_t mousekey_repeat_x = 0;
\def\mySet#1#2{\expandafter\def\csname myDef@#1\endcsname{#2}}
\def\mySetE#1#2{\expandafter\edef\csname myDef@#1\endcsname{#2}}
\def\myGet#1{\csname myDef@#1\endcsname}
@xinhaoyuan
xinhaoyuan / et_horizontal_scrolling.patch
Created November 22, 2018 03:28
Adding sort of horizontal scrolling and zooming support in et_viewer. Diffed from otp-22-dev
diff --git a/lib/et/src/et_wx_contents_viewer.erl b/lib/et/src/et_wx_contents_viewer.erl
index 580c921139..0bc70ce22a 100644
--- a/lib/et/src/et_wx_contents_viewer.erl
+++ b/lib/et/src/et_wx_contents_viewer.erl
@@ -47,9 +47,10 @@
filters, % List of possible filters
win, % GUI: Frame object
frame, % GUI: Frame object
- panel, % GUI: Panel object
- width, % GUI: Window width
GEN coverdata-clean
make[1]: Entering directory '/home/xinhaoyuan/morpheus-workspace/morpheus-app-test/ra_test_f775c65/deps/ra'
make[2]: Entering directory '/home/xinhaoyuan/morpheus-workspace/morpheus-app-test/ra_test_f775c65/deps/elvis_mk'
make[2]: Nothing to be done for 'noop'.
make[2]: Leaving directory '/home/xinhaoyuan/morpheus-workspace/morpheus-app-test/ra_test_f775c65/deps/elvis_mk'
make[2]: Entering directory '/home/xinhaoyuan/morpheus-workspace/morpheus-app-test/ra_test_f775c65/deps/aten'
make[2]: Leaving directory '/home/xinhaoyuan/morpheus-workspace/morpheus-app-test/ra_test_f775c65/deps/aten'
make[2]: Entering directory '/home/xinhaoyuan/morpheus-workspace/morpheus-app-test/ra_test_f775c65/deps/gen_batch_server'
make[2]: Leaving directory '/home/xinhaoyuan/morpheus-workspace/morpheus-app-test/ra_test_f775c65/deps/gen_batch_server'
make[1]: Leaving directory '/home/xinhaoyuan/morpheus-workspace/morpheus-app-test/ra_test_f775c65/deps/ra'
#!/usr/bin/env python
import zipfile
import os
import subprocess
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-f", type = str, dest = "filename", help = "filename")
parser.add_argument("-e", action = "store_true", dest = "to_extract", help = "To extract")
#!/bin/sh
# Consolas family has been rendered weirdly on Linux.
# Use fontforge to modify vertical metric fix the issue,
# but I am not complete sure since it's my first time to do it.
# It requires fontforge to be installed.
for ttf in consola*; do
fontforge -lang=ff -script <<EOF
function FindProxyForURL(url, host) {
if (shExpMatch(url, "http://127.0.0.1:8080/*")) {
return "SOCKS 127.0.0.1:8080";
}
else {
return "DIRECT";
}
}
/*INV{
{
# text at the begining of the file
prelude : """
"""
module_name : module_name
# text at the beginning of the module definition
module_prelude : """
#!/usr/bin/env python
from six.moves import range
import alist
import sys
def main(param):
print(param)
if __name__ == '__main__':
@xinhaoyuan
xinhaoyuan / xelatex-makefile
Created December 18, 2016 17:43
makefile for xelatex document
.PHONY: all clean
-include dep.mk
OUT ?= out
dep.mk:
@latexmk -silent -xelatex -dependents main.tex -MF dep.mk -outdir=${OUT}
clean: