Skip to content

Instantly share code, notes, and snippets.

@Dither
Dither / autopatchwork_mangadex.js
Last active June 7, 2018 23:33
MangaDex reader service script for AutoPatchWork mod
// ==UserScript==
// @description MangaDex reader service script for AutoPatchWork mod.
// @include https://mangadex.org*
// ==/UserScript==
(function(){
var on, off, trigger;
var base_url = '',
chapter_url = 'https://mangadex.org/chapter/',
data_url = '',
@Dither
Dither / autopatchwork_mangawindow.js
Last active February 16, 2018 12:04
Example of custom pager script for MangaWindow (original site's scripts should be disabled)
// ==UserScript==
// @description MangaWindow reader service script for AutoPatchWork mod.
// @include https://mangawindow.com/*
// ==/UserScript==
if (window.opera && ~location.pathname.indexOf('chapter')) {
// NSL error in Opera 12 caused by some random change in the site's code :(
/* // Additional CSS fixes:
.body-chapter .chapter-nav select, .body-chapter .chapter-nav select, .body-chapter .chapter-nav .nav-chas select {
color: #000;
@Dither
Dither / 0001.patch
Last active November 22, 2016 19:23
Enable permanent loading of webextensions from sources in about:debugging of latest Firefox Nightly
diff --git a/devtools/modules/devtools/client/aboutdebugging/components/addons/controls.js b/devtools/modules/devtools/client/aboutdebugging/components/addons/controls.js
--- a/devtools/modules/devtools/client/aboutdebugging/components/addons/controls.js
+++ b/devtools/modules/devtools/client/aboutdebugging/components/addons/controls.js
@@ -9,6 +9,8 @@
loader.lazyImporter(this, "AddonManager",
"resource://gre/modules/AddonManager.jsm");
+loader.lazyImporter(this, "AppConstants",
+ "resource://gre/modules/AppConstants.jsm");
@Dither
Dither / 0001.patch
Created November 14, 2016 16:45
Fix for long alerts going off-screen and incorrect string parsing of SQLite Manager
From ab3b625c6a89cb8c4348a228d778d0877425389c Mon Sep 17 00:00:00 2001
From: Dither <Dither@users.noreply.github.com>
Date: Mon, 14 Nov 2016 19:40:58 +0300
Subject: [PATCH] Fix for long alerts going off-screen and incorrect string parsing
---
sqlite-manager/chrome/content/createManager.js | 2 +-
sqlite-manager/chrome/content/exim.js | 6 +--
sqlite-manager/chrome/content/treeDataTable.js | 2 +-
sqlite-manager/chrome/resource/sqlite.js | 53 ++++++++++++++------------
@Dither
Dither / Firefox\config.js
Last active November 23, 2016 14:26
Temporary fix for unblocking unsigned xpi's in release Firefox versions (with other defaults).
//
try {
Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm", {}).eval("SIGNED_TYPES.clear()");
Components.classes["@mozilla.org/toolkit/crash-reporter;1"].getService(Components.interfaces.nsICrashReporter).submitReports = false;
} catch(ex) {}
// Disable extension signature check
pref("xpinstall.signatures.required", false);
// Disable checking if firefox is default browser
@Dither
Dither / CYRILLIC_FONT_FIX.md
Last active April 23, 2017 23:37
Если в графических редакторах (Photoshop, GIMP, Krita итп) не печатаются русские буквы русифицированных (sic!) шрифтов

Проблемы со шрифтами

В русской раскладке текст отображается не тем шрифтом, который выставлен

Проблема возникает из-за криво русифицированных шрифтов. Исправление NLS в реестре (на c_1251.nls) при этом неконструктивно.

Исправление русификации шрифта с помощью программы FontForge

  1. Запускаем FontForge. Загружаем в него «некорректный» шрифт (пропускаем все запросы). Проверяем: если в списке присутствует русский символ «А» (в прямоугольнике; чёрный на белом) и, при его выделении, под меню показывает текст 1040 (0x410) U+0410 "....." CYRILLIC CAPITAL LETTER A, тогда шрифт и правда русифицирован, просто не хватает указания кодовых страниц (из-за этого он и не работает как надо), их мы добавим в пункте 2.
@Dither
Dither / moon_phase.js
Created September 17, 2016 10:07
JS function to calculate moon phase
function moon_phase(date) { // ported from http://www.voidware.com/moon_phase.htm
var year = date.getYear(),
month = date.getMonth(),
day = date.getDay();
if (month < 3) {
year--;
month += 12;
}
@Dither
Dither / autopatchwork_dynastyscans.js
Created September 14, 2016 07:55
Dynasty Scans reader service script for AutoPatchWork Mod
// ==UserScript==
// @description dynasty-scans reader service script for AutoPatchWork mod.
// @include http://dynasty-scans.com/*
// ==/UserScript==
(function(){
document.addEventListener('DOMContentLoaded', function() {
var on, off, trigger;
var base_url = "http://dynasty-scans.com",
current_index = parseInt(location.hash.replace('#',''), 10) || 0,
@Dither
Dither / readability.js
Created August 8, 2016 10:25
Readability research version
// ==UserScript==
// @name Readability
// @include http://*
// @include https://*
/*jshint curly: false, es5: true, strict: false, loopfunc: true, scripturl: true, browser: true, devel: true, nonstandard: true*/
/*
* Copyright (c) 2010 Arc90 Inc
*
* Licensed under the Apache License, Version 2.0 (the 'License');
@Dither
Dither / autopatchwork_imgur.js
Last active July 12, 2016 18:09
Imgur gallery custom pattern for AutoPatchWork mod (autoclick "load more" and pagerize galleries)
// ==UserScript==
// @name Imgur service script for AutoPatchWork Mod (UserJS version)
// @include http://imgur.com/*/*
// @include https://imgur.com/*/*
// @run-at document-end
// ==/UserScript==
AutoPatchWorked.on('ready', function() {
var current_index = parseInt(location.hash.slice(1), 10) || 0,
img_arr_len = 0;