Skip to content

Instantly share code, notes, and snippets.

View blindFS's full-sized avatar
🤔
I may be slow to respond.

zc he blindFS

🤔
I may be slow to respond.
View GitHub Profile
@blindFS
blindFS / hs_window.lua
Last active January 21, 2019 15:29
hs_window.lua
local obj={}
obj.__index = obj
obj.name = "Windows"
obj.version = "1.0"
obj.author = "blindFS"
-- Internal function used to find our location, so we know where to load files from
local function script_path()
local str = debug.getinfo(2, "S").source:sub(2)
@blindFS
blindFS / init.lua
Last active January 20, 2019 13:42
Hammerspoon HSearch mod
local function openWithSafari(arg)
hs.osascript.applescript('tell window ' .. arg[1] .. ' of application "Safari"\nset current tab to tab ' .. arg[2] .. '\nactivate\nend tell')
end
local function openWithChrome(arg)
hs.osascript.applescript('tell application "Google Chrome"\nrepeat with win in windows\nif id of win = ' .. arg[1] .. ' then\nset active tab index of win to ' .. arg[2] .. '\nset index of win to 1\nend if\nend repeat\ndelay 0.1\ndo shell script "open -a Google\\\\ Chrome"\nend tell')
end
-- hs_btabs.lua
local function browserTabsRequest()
local safari_running = hs.application.applicationsForBundleID("com.apple.Safari")
ACTION=="add", ATTRS{idVendor}=="0f39", ATTRS{idProduct}=="0611", OWNER="farseer", RUN+="/home/farseer/bin/auto_xmodmap"
Processor Information:
Vendor: GenuineIntel
CPU Family: 0x6
CPU Model: 0x2a
CPU Stepping: 0x7
command! Wiki2Org :call Allwiki2Org()
function! Wiki2Org()
let b:enter_block = 0
let b:ordered_index = {}
let total_line = line("$")
for lino in range(1, total_line)
let line_content = getline(lino)
if line_content =~ '^[\t ]*{{{class=.\w*.'
let b:enter_block = 1
execute lino.'s/^[\t ]*{{{class=.\(\w*\)./#+begin_src \1'
% xetex/xelatex 字体设定宏包
\ProvidesPackage{zhfontcfg}
\usepackage[utf8]{inputenc}
\usepackage{fontspec,xunicode}
\usepackage[slantfont, boldfont, CJKspace, CJKmath]{xeCJK} % 允许斜体和粗体
\setCJKmainfont{WenQuanYi Micro Hei} % 设置缺省中文字体
\setCJKmonofont{WenQuanYi Micro Hei Mono} % 设置等宽字体
[Desktop Entry]
Name=Emacs
GenericName=Text Editor
Comment=Edit text
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=env LC_CTYPE=zh_CN.UTF-8 emacs %F
Icon=emacs
Type=Application
Terminal=false
Categories=Development;TextEditor;
#!/usr/bin/env python2
count = 0
def merge_sort(li):
if len(li) < 2:
return li
m = len(li) / 2
return merge(merge_sort(li[:m]), merge_sort(li[m:]))
@import url(http://fonts.googleapis.com/css?family=Inconsolata);
@import url(http://fonts.googleapis.com/css?family=PT+Sans);
@import url(http://fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700);
article,
aside,
details,
figcaption,
figure,
footer,
header,
\usepackage{fontspec}
\setmainfont{Arial}
\usepackage{xeCJK}
\setCJKmainfont{SimHei}
\usepackage[english]{babel} % English language/hyphenation
\usepackage{amsmath,amsfonts,amsthm} % Math packages
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{url}