Skip to content

Instantly share code, notes, and snippets.

@JenieX
JenieX / for_vs_forEach.html
Created May 25, 2022 02:13 — forked from jcunews/for_vs_forEach.html
Simple performance test comparison between `for` and `forEach()` loop. Both loops enumerates an array of 50,000,000 elements for 10 times.
<!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 {
@JenieX
JenieX / redditvideoquality.user.js
Created June 20, 2022 14:43 — forked from x0a/redditvideoquality.user.js
Forces the highest quality video on Reddit
// ==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
@JenieX
JenieX / beforescriptexecute-polyfill.js
Created June 21, 2022 00:36 — forked from x0a/beforescriptexecute-polyfill.js
Lightweight beforescriptexecute / onbeforescriptexecute polyfill
(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
@JenieX
JenieX / eslint_prettier_airbnb.md
Created June 22, 2022 06:20 — forked from bradtraversy/eslint_prettier_airbnb.md
ESLint, Prettier & Airbnb Setup

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
@JenieX
JenieX / youtube.com - Replace Apple Touch Icon.user.js
Created August 25, 2022 05:58 — forked from piejanssens/youtube.com - Replace Apple Touch Icon.user.js
Userscript: youtube.com - Replace Apple Touch Icon
// ==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://gist.github.com/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);
@JenieX
JenieX / crxcagrepper.py
Created September 25, 2022 04:08 — forked from sooshie/crxcagrepper.py
Download multiple versions of Chrome extension source from crxcavator.io and run a string search on the files.
# 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.
#
# sooshie@gmail.com
import requests
import json
@JenieX
JenieX / fastest_for.js
Created December 15, 2022 10:08 — forked from DungGramer/fastest_for.js
Find fastest way to loop through an array in Javascript
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) {
@JenieX
JenieX / git-commit-template.md
Created December 23, 2022 10:17 — forked from lisawolderiksen/git-commit-template.md
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

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

@JenieX
JenieX / checkImage.example.js
Created January 1, 2023 03:30 — forked from draeton/checkImage.example.js
Check the existence of an image file at `url` by creating a temporary Image element.
// Example Use
(function () {
function success() {
console.log("success: ", this.src);
}
function failure() {
console.log("failure: ", this.src);
}