Skip to content

Instantly share code, notes, and snippets.

@oflow
oflow / context-google-image-search.uc.js
Created April 25, 2016 02:12
右クリックメニューから画像検索
<?xml version="1.0" encoding="UTF-8"?>
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!--
// ==UserScript==
// @name Context Google Image Search
// @description 右クリックメニューから画像検索
// @version 1.0
// @include main
// @compatibility Firefox 45
// @author oflow
@font-face {
font-family: "Verdana";
src: local("Open Sans");
unicode-range: U+0000-007F;
}
@font-face {
font-family: "Arial";
src: local("Open Sans");
unicode-range: U+0000-007F;
['ajax', 'data-src', 'data-lazy-src', 'data-original', 'rel:bf_image_src'].forEach((attr) => {
var elms = document.querySelectorAll('*[' + attr.replace(/:/, '\\:') + ']');
for (var i = 0; i < elms.length; i++) {
if (elms[i].nodeName !== 'IMG') {
let img = document.createElement('img');
img.src = elms[i].getAttribute(attr);
img.style.cssText = 'max-width: 100%; max-height: 100%;';
elms[i].appendChild(img);
} else {
elms[i].src = elms[i].getAttribute(attr);
@oflow
oflow / font.css
Last active June 29, 2016 12:25
偉大なるWebデザイナー様のテンプレCSSフォント指定をなかったことにする
@namespace url(http://www.w3.org/1999/xhtml);
@font-face {
font-family: "MS Pゴシック";
src: local("メイリオ");
}
@font-face {
font-family: "Osaka";
src: local("メイリオ");
}
// ==UserScript==
// @name Redirect Linkis.com
// @description fuckin' ln.is iframe
// @include http://linkis.com/*
// ==/UserScript==
(function() {
var iframe = document.getElementById('source_site');
if (iframe) location.replace(iframe.src);
})();
@oflow
oflow / redis.js
Created July 29, 2016 03:03
node-redisでよく使うやつだけ
var Redis = require('redis');
function redisConnect() {
var client = Redis.createClient(),
redis = {
end: function() {
client.end();
for (let prop in redis) {
delete redis[prop];
}
@oflow
oflow / 例のアレ.css
Created August 18, 2016 07:57
5秒経っても悩んでたら答えがわかるよ!!
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url-prefix(http://www.arealme.com/japanese-vocabulary-size-test/ja) {
.answer {
background-color: #efe !important;
transition: background-color 1s ease 5s !important;
}
li:hover .answer[value="1"] {
background-color: #fbb !important;
}
@oflow
oflow / fuck_rakuten_header.css
Created August 31, 2016 03:59
最大値 2147483647 をそう易々と使うなボケ
@-moz-document domain(rakuten.co.jp) {
#rakutenLimitedId_header > .riShopHdrWrap {
z-index: 900 !important;
}
}
// ==UserScript==
// @name Fuck you <INPUT onpaste="return false">
// @description 貼り付け禁止すんな殺すぞ!
// @include https://*
// ==/UserScript==
/* https://developer.mozilla.org/en-US/docs/Web/API/Event/stopImmediatePropagation */
document.addEventListener('paste', event => event.stopImmediatePropagation(), true);
@oflow
oflow / dospara_tax_include.user.js
Last active December 6, 2016 06:14
ドスパラは(+税)の表示やめろ!
// ==UserScript==
// @name ドスパラ税込み表示
// @description ドスパラは(+税)の表示やめろ!
// @include http://www.dospara.co.jp/*
// ==/UserScript==
'use strict';
['em[itemprop="price"]', '.itemSearchTable .price', 'span.rankingAreaPrice'].forEach(query => {
document.querySelectorAll(query).forEach(elm => {
var price = Number(elm.textContent.split('円')[0].replace(/[^\d]/g, ''));