This file contains 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
/* | |
* Some JS objects like InputDeviceInfo or GeolocationCoordinates are impossible to clone easly. | |
* `Object.keys(obj)` returns `{}` | |
* `JSON.stringify(obj)` returns `{}` | |
* | |
* with following functions you're able to clone object properties to the simple object. | |
*/ | |
function cloneGeolocationCoordinates(instance) { | |
return Object.keys(instance.constructor.prototype).reduce((acc, key) => { |
This file contains 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
// Extra filters for https://github.com/kig/canvasfilters.git | |
Filters.scaleUp = function (imageData, scale = 2) { | |
const sourceWidth = imageData.width; | |
const sourceHeight = imageData.height; | |
const targetWidth = parseInt(sourceWidth * scale, 10); | |
const targetHeight = parseInt(sourceHeight * scale, 10); |
This file contains 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
/* | |
* This code helps with logging image processed in the worker. | |
* | |
* Simple visual explanation for image transformation. | |
*/ | |
// WORKER: | |
postMessage({ | |
imageData, | |
}); |
This file contains 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 initialNumberOfPairs = 1; | |
let adultPairsNumber = 0; | |
let youngPairsNumber = initialNumberOfPairs; | |
for (let i = 1; i <= 12; ++i) { | |
const prevAdultPairsNumber = adultPairsNumber; | |
adultPairsNumber = adultPairsNumber + youngPairsNumber; | |
youngPairsNumber = prevAdultPairsNumber; |
This file contains 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
/** | |
* Transfer localStorage easly with chrome console. | |
* Paste this into web console of source page, then paste function's result to destination console. | |
**/ | |
(function() { | |
let result = 'localStorage.clear();\n'; | |
Object.keys(localStorage).forEach((key) => { | |
result += `localStorage["${key}"] = ${JSON.stringify(localStorage[key])};\n` | |
}); |
This file contains 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 Slack: more space for channels | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Cezary Nowak | |
// @match https://app.slack.com/client/* | |
// @icon https://www.google.com/s2/favicons?domain=slack.com | |
// @grant none | |
// ==/UserScript== |
This file contains 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 Slack: remove huddle | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Cezary Nowak | |
// @match https://app.slack.com/client/* | |
// @icon https://www.google.com/s2/favicons?domain=slack.com | |
// @grant none | |
// ==/UserScript== |
This file contains 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
#define X_SLAVE_ADDRESS 0 | |
#define Y_SLAVE_ADDRESS 2 | |
#define Z_SLAVE_ADDRESS 1 | |
#define E0_SLAVE_ADDRESS 3 | |
==== | |
https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/Marlin/src/core/boards.h | |
This file contains 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
$$('td[colspan="6"]').forEach((el) => el.parentNode.remove()) |