Skip to content

Instantly share code, notes, and snippets.

@ZaneHannanAU
ZaneHannanAU / add-event-listeners.js
Last active Jun 4, 2018
Event listener add multiple simultaneous.
View add-event-listeners.js
Object.defineProperty(self || this, 'addEventListeners', {
value: function addEventListeners(target, listeners, opts = {}) {
if (listeners === undefined)
return addEventListeners(this, target, opts)
if ('function' === typeof opts.init) opts.init.call(target)
if (opts.addSelf) Object.defineProperty(target, 'string' === typeof opts.addSelf ? opts.addSelf : addEventListeners.name, {
enumerate: true,
value: addEventListeners
})
for (const listener in listeners)
@ZaneHannanAU
ZaneHannanAU / fuckItUp.js
Last active Apr 13, 2018
mangadex forums fuck up your text
View fuckItUp.js
// ==UserScript==
// @name Rainbowfy
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://mangadex.org/forum
// @match https://mangadex.org/forums
// @match https://mangadex.org/forum/*
// @match https://mangadex.org/forums/*
@ZaneHannanAU
ZaneHannanAU / test-totp.js
Last active Mar 30, 2018
integrated totp (nodejs)
View test-totp.js
const {fn: {b32_buf, buf_b32, getOTP}} = require('./totp')
const givea = fuck => console.log('%s %j', fuck.length.toString().padStart(4), fuck.toString())
const it = process.hrtime()
const rt = ([s,ns] = process.hrtime(it)) => console.log('%ss elapsed', (s+ns/1e9).toFixed(9).padStart(12))
rt()
const fucks = Buffer.from('Hi there fucks')
givea(fucks)
@ZaneHannanAU
ZaneHannanAU / HorribleSubs.user.js
Created Mar 27, 2018
horriblesubs magnet links only
View HorribleSubs.user.js
// ==UserScript==
// @name HorribleSubs
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://horriblesubs.info/*
// @grant none
// ==/UserScript==
@ZaneHannanAU
ZaneHannanAU / nu-series-autoadd.js
Created Mar 27, 2018
autoadd series novelupdates
View nu-series-autoadd.js
// ==UserScript==
// @name NovelUpdates Series autoadd
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.novelupdates.com/series/*
// @grant none
// ==/UserScript==
@ZaneHannanAU
ZaneHannanAU / badwords.txt
Created Jul 25, 2017
A function to remove "bad" words from generated XKCD passwords.
View badwords.txt
# Newline separated badwords filter using Regular expressions
assh.*
bitch.*
chink
cunt.*
daygo
dick.*
douche
fag.*
fatass
View dateFormat.js
// Server side NodeJS.
var dateFormat = module.exports = {}
dateFormat.opts = {
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
month: 'long',
weekday: 'long',
year: 'numeric',
timeZoneName: 'long'
View datasrc-into-src_bookmarklet.js
// Grab all images
for(i=0;i<document.images.length;i++)
{
// if document.images[i].getAttribute("data-src"){ // If there's a "data-src" attribute on them
document.images[i].src = document.images[i].getAttribute("data-src"); // Set the src value to that of the data-src value
document.images[i].style.visibility = "visible";
document.images[i].style.opacity = 1;
// }
}
You can’t perform that action at this time.