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
(function () { | |
// Monkey patch `webkitRequestFileSystem` to call success callback even if the request failed | |
(function(webkitRequestFileSystem) { | |
window.webkitRequestFileSystem = function(type, size, successCallback, errorCallback) { | |
webkitRequestFileSystem(type, size, successCallback, successCallback); | |
} | |
})(window.webkitRequestFileSystem); | |
})(); |
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
// ==UserScript== | |
// @name Incognito trick | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Prevent sites detecting if you're in incognito by calling the success callback of webkitRequestFileSystem even if it's failing. | |
// @author You | |
// @run-at document-start | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== |
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
function detectWebkitRequestFileSystem(e, t) { | |
return new Promise(function(e) { | |
if (!window.webkitRequestFileSystem) | |
return e(null); | |
window.webkitRequestFileSystem(window.TEMPORARY, 1, e.bind(null, !1), e.bind(null, !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
MIT License | |
Copyright (c) 2017 Mátyás Fodor | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
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
function _zip(func, args) { | |
const iterators = args.map(arr => arr[Symbol.iterator]()); | |
let iterateInstances = iterators.map((i) => i.next()); | |
ret = [] | |
while(iterateInstances[func](it => !it.done)) { | |
ret.push(iterateInstances.map(it => it.value)); | |
iterateInstances = iterators.map((i) => i.next()); | |
} | |
return ret; | |
} |
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
function arr(n) { | |
return Array(n+1).join(1).split(''); | |
} | |
const a = arr(1000000) | |
a[100] = 2 | |
a[1000] = 2 | |
a[10000] = 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
const sizedArray = (n) => Array(n).fill(); | |
const times = (n, cb) => { | |
while (0 < n--) { | |
cb(); | |
} | |
} | |
const fillWithCb = (n, cb) => sizedArray(n).map(cb); |
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
// ==UserScript== | |
// @name Trello TODO list | |
// @namespace Trello | |
// @version 0.1 | |
// @description Fit 5 columns into a 13" Macbook screen | |
// @author Matyas Fodor | |
// @match https://trello.com/* | |
// @grant none | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name Sort Answers | |
// @namespace TBD | |
// @version 1.0.0.1 | |
// @description sorts SO answers in descending order by vote count. The accepted answer is the first one. | |
// @author matyasfodor | |
// @include /https?:\/\/(meta\.)?stackoverflow\.com/questions/.*/ | |
// @grant none | |
// ==/UserScript== | |
/* jshint -W097 */ |
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 head = document.getElementsByTagName("head")[0]; | |
var script = document.createElement("script"); | |
script.src = "//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"; | |
head.appendChild(script); | |
var a = $('span.rfloat'); |