- Toggle full screen control + command + F
- Quit app comman + Q
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple XML parser | |
* @param {String} xml | |
* @return {Object} | |
*/ | |
function parseXML(xml) { | |
var beg = -1; | |
var end = 0; | |
var tmp = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 根据 github emoji 标记转换的搜狗输入法自定义短语 | |
smile,2=😄 | |
laughing,2=😆 | |
blush,2=😊 | |
smiley,2=😃 | |
relaxed,2=☺️ | |
smirk,2=😏 | |
heart_eyes,2=😍 | |
kissing_heart,2=😘 | |
kissing_closed_eyes,2=😚 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
pushd ~/.config; | |
curl -s -o proxyss.pac http://127.0.0.1:1089/proxy.pac | |
if [ "$?" = "0" ]; then | |
cat proxyss.pac proxyw2.js > proxy.pac | |
cat proxyw2_pre.js proxyw2.js > proxyw2.pac | |
# find active network service and set autoproxy url | |
services=$(networksetup -listnetworkserviceorder | grep 'Hardware Port') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* statistics of a set | |
* @typedef {object} stat | |
* @prop {numher} count | |
* @prop {number} average | |
* @prop {number} variance | |
*/ | |
/** | |
* combine variances |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Bookmarklet: | |
//javascript:!function(){var o=location.host.slice(-9);"github.io"==o?location.href.replace(/\/\/([^\.]+)\.github\.io\/([^\/]+)/,function(o,t,i){location.href="https://github.com/"+t+"/"+i}):"ithub.com"==o&&location.href.replace(/github\.com\/([^\/]+)\/([^\/]+)/,function(o,t,i){location.href="https://"+t.toLowerCase()+".github.io/"+i})}(); | |
(function(){ | |
var host = location.host.slice(-9); | |
if(host == 'github.io'){ | |
location.href.replace(/\/\/([^\.]+)\.github\.io\/([^\/]+)/, function(a, name, project){ | |
location.href = 'https://github.com/' + name + '/' + project; | |
}) | |
} else if (host == 'ithub.com') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isCompressed = (function(){/*This comment will be removed in compression*/}+'').length < 15; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $ = function(s){ | |
if(!(this instanceof $)){ | |
return new $(s); | |
} | |
this.push.apply(this, document.querySelectorAll(s)); | |
} | |
$.fn = $.prototype = []; | |
$.fn.each = function(fn){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Fake AJAX | |
$.fajax = function(options){ | |
options = $.extend({ | |
fTime: 16, //delay time | |
fData: {status: 1}, //response data | |
fDone: true //success or not | |
}, options); | |
return new $.Deferred(function(dfd){ |
NewerOlder