Skip to content

Instantly share code, notes, and snippets.

View yxjxx's full-sized avatar
🎯
Focusing

Jing Yang yxjxx

🎯
Focusing
View GitHub Profile
@yxjxx
yxjxx / impbcopy.m
Created April 28, 2017 18:58 — forked from mwender/impbcopy.m
Command line copy an image file to the clipboard in Mac OS X. See first comment for install instructions.
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <unistd.h>
BOOL copy_to_clipboard(NSString *path)
{
// http://stackoverflow.com/questions/2681630/how-to-read-png-image-to-nsimage
NSImage * image;
if([path isEqualToString:@"-"])
{
// http://caiustheory.com/read-standard-input-using-objective-c
@yxjxx
yxjxx / alfred-pinyin.py
Created January 6, 2016 00:53 — forked from tiann/alfred-pinyin.py
make alfred support pinyin search
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# @author weishu @2015/12/7
import subprocess
import os
import re
import json
@yxjxx
yxjxx / surge.conf
Created October 5, 2015 02:12 — forked from netputer/surge-multi-proxy.url
Surge config for SSLedge (Sample)
[Proxy]
# 为了方便将来修改,将可用服务器写成 Proxy 形式
US = protocol, us.server.com, port1, username, password
JP = protocol, jp.server.com, port2, username, password
# 要用美服,就把美服那行复制到下面,然后改叫 SSLEDGE
SSLEDGE = protocol, us.server.com, port1, username, password
# 要换日服,就把日服那行复制到下面,然后改叫 SSLEDGE
# 同名 Proxy,Surge 只保留最后一个
@yxjxx
yxjxx / 0_reuse_code.js
Created September 29, 2015 02:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@yxjxx
yxjxx / alternative.yaml
Last active March 29, 2024 05:53 — forked from lotem/alternative.yaml
Rime中文输入状态下也使用英文标点
###中文输入法下也使用英文标点2013/8/14 yxj
###有些用戶習慣在中文裏使用ASCII標點,那麼與其一個一個覆寫,不如 整套都換掉 。
###取得這份設定檔—— Rime 別樣設定,使用西文標點(一个gist:https://gist.github.com/lotem/2334409) 在用戶資料夾保存爲 alternative.yaml ;
###再將輸入方案中的「導入 default 設定」通過打 patch 替換爲「導入 alternative 設定」
###刚刚遇到一个问题,因为教程里面说需要这前两行,所以就直接粘贴了,但是发现模糊音失效了,找到原因是[只能有一个patch:,因为上面已经有了,所以就下面就不要了,注意缩进,两个英文空格]
###又加入了一行代码['key_binder/import_preset': alternative]作用是让[ ]可以翻页,如果一开始就用 [ 上翻页的会连高亮的字加[都一起上屏「比如你好[ 」就会这样了,哈哈
###patch:
##'punctuator/import_preset': alternative
##'key_binder/import_preset': alternative
######