Instantly share code, notes, and snippets.

View getFBPageId.js
(function () {
var fbPage = function () {
var that = {},
_paths = location.pathname.split('/');
var hasUserName = function () {
return _paths.length == 2;
};
var getId = function () {
if (hasUserName()) {
View firegestures_keypress.js
var event = document.createEvent("KeyEvents");
event.initKeyEvent("keypress",
true,
true,
null,
false, // holds Ctrl key
true, // holds Alt key
false, // holds Shift key
false, // holds Meta key
0, // presses a special key, @see http://mxr.mozilla.org/mozilla/source/dom/public/idl/events/nsIDOMKeyEvent.idl
View min_font_size.js
function (ev, arg) {
const MIN_FONT_SIZE = 14, // 最小フォントサイズ
CONFIG_PREFIX = "font.minimum-size.",
COUNTRY_CODES = ["ar", "el", "he", "ja", "ko" , "th", "tr",
"x-armn", "x-baltic", "x-beng", "x-cans", "x-central-euro",
"x-cyrillic", "x-devanagari", "x-ethi", "x-geor", "x-gujr",
"x-guru", "x-khmr", "x-knda", "x-mlym", "x-orya", "x-sinh",
"x-tamil", "x-telu", "x-tibt",
"x-unicode", "x-user-def", "x-western",
"zh-CN", "zh-HK", "zh-TW" ];
View getFacebookPageFeed.js
(function(){
var fbPage = function(){
var that = {},
_paths = location.pathname.split('/');
var hasUserName = function(){ return _paths.length == 2; };
var feed = function(id){
var req = new XMLHttpRequest();
req.onload = function () {
View feedle+fulltextrssfeed.js
(function(){
var l=location,
fullfeed="http://fulltextrssfeed.com/",
feedly="http://www.feedly.com/home#subscription/feed/";
l.href=feedly+fullfeed+l;
})();
View feedly.js
(function(){
var l=location,
feedly="http://www.feedly.com/home#subscription/feed/";
l.href=feedly+l;
})();
View setControlPanel.js
var setControlPanel = function(cmd, title, keystrokes){
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run(cmd);
do {
WScript.Sleep(100);
} while(!WshShell.AppActivate(title));
WshShell.SendKeys(keystrokes);
};
setControlPanel(WScript.Arguments.item(0),
View setControlPanel.js
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run(WScript.Arguments.item(0));
WScript.Sleep(500);
WshShell.AppActivate(WScript.Arguments.item(1));
WScript.Sleep(100);
var Keystrokes = WScript.Arguments.item(2)
WshShell.SendKeys(Keystrokes);
View changeMouseButton.js
var setControlPanel = function(cmd, title, keystrokes){
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run(cmd);
do {
WScript.Sleep(100);
} while(!WshShell.AppActivate(title));
WshShell.SendKeys(keystrokes);
};
setControlPanel("control main.cpl",
View remap_arrowkey.ahk
!RWin::Send {Left}
!RCtrl::Send {Right}
!RShift:: Send {Up}
!APPSKEY:: Send {Down}
![::Send {HOME}
!'::Send {END}