Skip to content

Instantly share code, notes, and snippets.

@hqingyi
hqingyi / bind_key_for_popclip.md
Created November 5, 2015 07:20
用键盘调出 PopClip

通常情况下,我们调出 PopClip 工具条需要用鼠标选中一段文字,但这在编辑文字时会显得有些不便,那么如何直接用键盘调出 PopClip 呢?Mac 自带的小机器人 Automator,可以实现很多 Mac 自动化的流程。打开 Automator,新建一个「Service」(即「服务」),利用 AppleScript 写一段代码。这里要注意的是,上方的「服务」我们要选择「没有输出」。

复制下面代码替换:

on run {input, parameters}

  tell application "PopClip" to appear
 
@hqingyi
hqingyi / git_ssh.md
Last active October 23, 2015 08:05
使用ssh搭建简易私有的git服务器

准备

相关服务

apt-get install git

用户配置

adduser --shell /usr/bin/git-shell git
@hqingyi
hqingyi / mkfileswap.sh
Created July 6, 2015 09:25
make file swap.
#!/bin/bash
# N and BYTES may be followed by the following multiplicative suffixes:
# c =1, w =2, b =512, kB =1000, K =1024, MB =1000*1000, M =1024*1024
help(){
echo "useage: `basename $0` -o full_path -b block_size(default 1K) -c block_count(default 2M)"
}
while getopts 'o:b:c:' OPT; do
case $OPT in