Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name RefreshPdf
// @namespace xinhaoyuan@gmail.com
// @description Refresh pdf in current view
// @include *.pdf*
// @version 1
// @grant none
// ==/UserScript==
(function () {
document.addEventListener('keydown', function (e) {
@xinhaoyuan
xinhaoyuan / mintty-2.7.0-even-line-highlight.patch
Last active November 22, 2016 16:27
Highlighting the background of even lines when control + alt is pressed. Handy for aligning lines.
diff -ru mintty-2.7.0/src/term.h mintty-2.7.0-modified/src/term.h
--- mintty-2.7.0/src/term.h 2016-11-11 08:27:15.000000000 -0500
+++ mintty-2.7.0-modified/src/term.h 2016-11-22 00:01:05.582947600 -0500
@@ -462,6 +462,9 @@
termresults results;
termimgs imgs;
+
+ bool even_line_highlight_mode;
+ bool even_line_highlight_toggle;
@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:
#!/usr/bin/env python
from six.moves import range
import alist
import sys
def main(param):
print(param)
if __name__ == '__main__':
/*INV{
{
# text at the begining of the file
prelude : """
"""
module_name : module_name
# text at the beginning of the module definition
module_prelude : """
function FindProxyForURL(url, host) {
if (shExpMatch(url, "http://127.0.0.1:8080/*")) {
return "SOCKS 127.0.0.1:8080";
}
else {
return "DIRECT";
}
}
#!/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
#!/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")
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'
@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