Skip to content

Instantly share code, notes, and snippets.

View kejun's full-sized avatar
💭
I may be slow to respond.

kejun kejun

💭
I may be slow to respond.
View GitHub Profile
@kejun
kejun / gist:1069908
Created July 7, 2011 16:28
豆瓣说快捷键
javascript:void(function(_d){ var s = _d.createElement('script'); s.type = 'text/javascript'; s.src = 'http://kejun.github.com/demos/floatline.js'; _d.getElementsByTagName('head')[0].appendChild(s); }(document));
au BufWritePost *.less silent !lessc -x %:p > %:r.css
@kejun
kejun / GM Script: 自动用xiami播放专辑
Created January 12, 2011 10:29
Douban音乐推荐直接用xiami播放
// ==UserScript==
// @name douban_xiami
// @namespace org.kejun
// @include http://music.douban.com/*
// ==/UserScript==
//使用说明:
// 1. 安装本脚本到Greasemonkey
// 2. 到http://music.douban.com/recommended
// 3. 点击专辑封面会自动用虾米播放(如果窗口没弹出,检查是否被浏览器拦截)
var getCarePos = function (node) {
var range, range2, pos = [];
if (document.selection) {
range = document.selection.createRange();
range2 = range.duplicate();
range2.moveToElementText(node);
range2.setEndPoint('EndToEnd', range);
pos = [range2.text.length - range.text.length, range2.text.length];
} else {
pos = [node.selectionStart, node.selectionEnd];
javascript:(function(){var api='https://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?url={URL}&container=focus&gadget=a&no_expand=1&rewriteMime=image%2F*&nocache=1',imgs=document.getElementsByTagName('img'),i=0,img;for(;img=imgs[i++];){if(img.src.indexOf('googleusercontent') < 0 && /farm3|farm5/i.test(img.src)){img.src=api.replace('{URL}',img.src);}}})();