Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name Skip steamcommunity.com/linkfilter
// @namespace dev/null
// @include https://steamcommunity.com/linkfilter/?url=*
// @version 0.1
// @run-at document-start
// @grant none
// ==/UserScript==
if(/\?url=(.*)$/.test(location.href))
// Auto Private, https://addons.mozilla.org/addon/auto-private/ (code from v.1.5 + some modifications)
var prefs = {
name: ["extensions.autoprivate.domains", "extensions.autoprivate.parts"],
domains: "",
parts: "",
init: function() {
var name1 = this.name[0];
var name2 = this.name[1];
var defaultBranch = Services.prefs.getDefaultBranch("");
if(defaultBranch.getPrefType(name1) != defaultBranch.PREF_STRING)
@Infocatcher
Infocatcher / arrayIterationPerformance.js
Created June 19, 2014 19:01
Array iteration performance, replace performance.now() with Date.now() or new Date().getTime() in old browsers
var c = 20e3;
var arr = "abcdefghijklmnopqrstuvwxyz".split("");
var i = c + 1, t = performance.now();
while(--i) {
for(var j = 0, l = arr.length; j < l; ++j)
var v = arr[j];
}
var dtFor = performance.now() - t;
@Infocatcher
Infocatcher / maxDate.js
Created June 16, 2014 09:29
Max JavaScript date
// Result: 0x1eb208c2dc0000 (Sat, 13 Sep 275760 00:00:00 GMT)
var time = 0;
var add = 0x10000;
for(;;) {
var newTime = time + add;
if(newTime == time) {
alert("Looke like max integer: 0x" + time.toString(16));
break;
}
var date = new Date(newTime);
@Infocatcher
Infocatcher / __proto__.js
Last active August 29, 2015 14:02
__proto__ vs usable Object.create() wrapper
var c = 100e3;
var proto = {
a: 0,
b: {},
c: [],
d: function() {},
e: /./
};
@Infocatcher
Infocatcher / RegExpHighlightTest.js
Created June 4, 2014 16:05
Testcase for JavaScript syntax highlighting (regular expressions)
// Regular expressions
var r = /\//i;
var r = /[\/*]/img;
var r = /[a-z]{5}/;
var r = /[a-z]{1,5}/;
var r = /([a-z])+/;
var r = /([a-z]{1,5})+/;
var r = /f([a-z])/;
var r = /a(b)c(d)/;
if(/\*/.test(s));
@Infocatcher
Infocatcher / panel.js
Last active August 29, 2015 14:02
Panel example (not only) for Custom Buttons for Firefox
// https://gist.github.com/Infocatcher/979c6ac08f86554ab7af
(function() {
var uri = "https://addons.mozilla.org/";
var initialSize = 300;
var horizontal = true;
var before = true;
var inTab = true;
var textZoom = 1;
var fullZoom = 1;
@Infocatcher
Infocatcher / autoSaveSession.js
Created April 21, 2014 09:36
autoSaveSession.js for AkelPad (test version)
// http://akelpad.sourceforge.net/forum/viewtopic.php?p=24561#24561
// http://infocatcher.ucoz.net/js/akelpad_scripts/autoSaveSession.js
// https://github.com/Infocatcher/AkelPad_scripts/blob/master/autoSaveSession.js
// (c) Infocatcher 2012-2014
// version 0.2.0 - 2014-04-06
// Automatically saves current session after selection or scroll changes
// Required Sessions plugin!
@Infocatcher
Infocatcher / userAgentSwitcherIcons.css
Created April 11, 2014 16:13
Icons for User Agent Switcher Firefox extension, example style for userChrome.css
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@-moz-document url("chrome://browser/content/browser.xul") {
/* User Agent Switcher */
menu[id^="useragentswitcher-"] {
-moz-binding: url("chrome://global/content/bindings/menu.xml#menu-iconic") !important;
}
menu[id^="useragentswitcher-"] > .menu-iconic-left {
-moz-appearance: menuimage !important;
// http://akelpad.sourceforge.net/forum/viewtopic.php?p=17271#17271
// http://infocatcher.ucoz.net/js/akelpad_scripts/tileTabs.js
// https://github.com/Infocatcher/AkelPad_scripts/blob/master/tileTabs.js
// (c) Infocatcher 2012-2013
// version 0.1.2 - 2013-02-24
// Tile current tab with next selected:
// select first tab, call script and then select second tab.
// Required MDI window mode!