| // npx jscodeshift --parser=ts add-import-extensions.js src/ | |
| module.exports = function(fileInfo, api) { | |
| const j = api.jscodeshift; | |
| const root = j(fileInfo.source); | |
| root.find(j.ImportDeclaration).forEach(path => { | |
| const source = path.value.source; | |
| if (source.value.startsWith('.') && !source.value.endsWith('.js')) { | |
| source.value += '.js'; |
| import { createServer } from "node:net"; | |
| import { PGlite } from "@electric-sql/pglite"; | |
| const PORT = 5432; | |
| const db = new PGlite(); | |
| await db.exec(` | |
| CREATE TABLE IF NOT EXISTS test ( | |
| id SERIAL PRIMARY KEY, | |
| name TEXT |
| function prefixer(prefix) { | |
| return function (...data) { | |
| console.log( | |
| data | |
| .map((d) => JSON.stringify(d, null, 2)) | |
| .join(" ") | |
| .split("\n") | |
| .map((line) => `${prefix}${line}`) | |
| .join("\n") | |
| ); |
| <script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script> |
| // HOW TO USE: | |
| // 0. Get OAuth from https://developers.google.com/youtube/registering_an_application | |
| // 1. Go to https://www.youtube.com/feed/library | |
| // 2. Paste snippet below in DevTools | |
| // 3. Replace `VIDEOS` with copied data | |
| // 4. Run script | |
| // JSON.stringify( | |
| // Array.from(document.querySelectorAll("a.ytd-playlist-video-renderer")) | |
| // .map((v) => { |
| #!/usr/bin/env bash | |
| fn() { | |
| echo "Return is just placeholder exit code, rely on command instead" | |
| return 1 | |
| } | |
| i=1 | |
| while true; do |
| # Get videos with: | |
| # | |
| # const videoElements = Array.from( | |
| # document | |
| # .querySelector("ytd-playlist-video-list-renderer") | |
| # .querySelectorAll("ytd-playlist-video-renderer") | |
| # ); | |
| # | |
| # const links = videoElements | |
| # .map((el) => `"${el.querySelector("a").href}"`) |
| 'use strict'; | |
| module.exports = function (element, callback) { | |
| var allImgsLength = 0; | |
| var allImgsLoaded = 0; | |
| var allImgs = []; | |
| var filtered = Array.prototype.filter.call(element.querySelectorAll('img'), function (item) { | |
| if (item.src === '') { | |
| return false; |