Javascript FOR OF with loop index.
for (const [index, value] of [1, 2, 3, 4, 5].entries()) {
console.log(index, value);
}
// => 0 1
// => 1 2
// => 2 3
// => 3 4
{ | |
"$ref": "file:../../node_modules/nx/schemas/project-schema.json", | |
"sourceRoot": "apps/checkout", | |
"projectType": "application", | |
"targets": { | |
"build": { | |
"executor": "@nrwl/next:build", | |
"outputs": ["{options.outputPath}"], | |
"defaultConfiguration": "production", | |
"options": { |
import NextErrorComponent, { ErrorProps } from 'next/error'; | |
import { captureException, flush } from '@sentry/nextjs'; | |
import type { NextPage, NextPageContext } from 'next/types'; | |
export interface AppErrorProps extends ErrorProps { | |
err?: Error; | |
hasGetInitialPropsRun?: boolean; | |
} |
// ==UserScript== | |
// @name MacBook Chrome Optimizer | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== |
// ==UserScript== | |
// @name JPG Store Optimizer | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.jpg.store/collection/unwantedones* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=jpg.store | |
// @grant none | |
// ==/UserScript== |
Javascript FOR OF with loop index.
for (const [index, value] of [1, 2, 3, 4, 5].entries()) {
console.log(index, value);
}
// => 0 1
// => 1 2
// => 2 3
// => 3 4
Copies the foo.txt
file from the experiment
branch to the main
branch.
git switch main
git restore --source experiment -- foo.txt
// ==UserScript== | |
// @name CoinMarketCap Portfolio Tracker Title | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description try to take over the world! | |
// @author Bruno Silva | |
// @match https://coinmarketcap.com/portfolio-tracker/ | |
// @icon https://www.google.com/s2/favicons?domain=coinmarketcap.com | |
// @grant none | |
// ==/UserScript== |
document.querySelector('div.game_intro__inner.start > p').click(); | |
setTimeout(() => { | |
document.querySelector('div.game_intro__inner.end > div > p.continue').click(); | |
var lastXp = 0; | |
function loop() { | |
var stage = parseInt(document.querySelector('div.ui > div > div.ui_progress__stage').innerText.slice(6)); | |
try { | |
var xp = parseInt(document.querySelector('div.game_inner__footer > div.resources > div').innerText.replace('xp', '')); |