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 cubicBezier(x1, y1, x2, y2){ | |
| var p1 = [x1, y1], p2 = [x2, y2]; | |
| this.calculate = function(t){ | |
| return [ | |
| 0 * Math.pow(1-t, 3) + p1[0] * 3 * Math.pow(1-t, 2) * t + p2[0] * 3 * (1-t) * Math.pow(t, 2) + 1 * Math.pow(t, 3), | |
| 0 * Math.pow(1-t, 3) + p1[1] * 3 * Math.pow(1-t, 2) * t + p2[1] * 3 * (1-t) * Math.pow(t, 2) + 1 * Math.pow(t, 3), | |
| ]; | |
| }; | |
| } |
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(window, document){ | |
| if (typeof window.chrome != "undefined") { | |
| document.themeColorMeta = document.createElement("meta"); | |
| document.themeColorMeta.name = "theme-color"; | |
| document.themeColorMeta.content = "transparent"; | |
| document.head.appendChild(document.themeColorMeta); | |
| Object.defineProperty(window, "themeColor", { | |
| get: function(){ | |
| return document.themeColorMeta.content; | |
| }, |
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
| Object.defineProperty(SVGPolygonElement.prototype, 'pathLength', { | |
| get: function(){ | |
| var numPoints = this.points.length || this.points.numberOfItems; | |
| var l = 0; | |
| for (var i = 1; i < numPoints; i++) { | |
| var point2 = this.points[i] || this.points.getItem(i); | |
| var point1 = this.points[i-1] || this.points.getItem(i-1); | |
| l += Math.sqrt(Math.pow(Math.abs(point2.x-point1.x),2)+Math.pow(Math.abs(point2.y-point1.y),2)); | |
| } | |
| return l; |
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
| "use strict"; | |
| class Spline{ | |
| constructor(points){ | |
| if(points.length % 2 !== 0 || points.length < 6){ | |
| return undefined; | |
| } | |
| this.x = []; | |
| this.y = []; | |
| for(var i=0; i < points.length; i+=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
| // ==UserScript== | |
| // @name Steam Wishlist Discount Sort | |
| // @namespace http://steamcommunity.com/ | |
| // @version 0.1.3 | |
| // @description Adds discount sort button and allows sorting by discounts descending | |
| // @author Chris Margroff | |
| // @match *://steamcommunity.com/*/*/wishlist* | |
| // @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 PkmnCards Random Hotkey | |
| // @namespace https://pkmncards.com/ | |
| // @version 0.1.3 | |
| // @description Adds a keyboard hotkey to jump to a random card. | |
| // @author Chris Margroff | |
| // @match https://pkmncards.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 Steam Tag Page Hotkeys | |
| // @namespace http://store.steampowered.com/ | |
| // @version 0.1 | |
| // @description Hotkeys for paging through discovery queue on tag pages | |
| // @author Chris Margroff | |
| // @match http://store.steampowered.com/tag/*/* | |
| // @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
| AudioNode.prototype.originalConnect = AudioNode.prototype.connect; | |
| AudioNode.prototype.originalDisconnect = AudioNode.prototype.disconnect; | |
| //event.detail is the connected or disconnected node | |
| Object.defineProperties(AudioNode.prototype, { | |
| connect: { | |
| value: function(){ | |
| if (arguments[0] instanceof AudioNode) { | |
| arguments[0].dispatchEvent(new CustomEvent('inputconnected', {detail: this})) | |
| } |
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 Pkmn Cards Proxy Print Layout | |
| // @namespace https://pkmncards.com/ | |
| // @version 0.2.2 | |
| // @description Format print layout better | |
| // @author Chris Margroff | |
| // @match https://pkmncards.com/proxy/* | |
| // @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
| var lastCpus = []; | |
| var lastTimestamp = 0; | |
| const { performance } = require('perf_hooks'); | |
| function AvgList(limit){ | |
| this.measures = []; | |
| this.totalTime = 0; | |
| this.limit = limit; | |
| this.push = function(measure){ | |
| if ((this.totalTime + measure.delta) > this.limit) { |
OlderNewer