Install dependencies: npm install playwright cheerio node-html-markdown
Install firefox browser: npx playwright install firefox
Run the script: tsx html-to-md.ts https://mistral.ai/fr/news/mixtral-8x22b/
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
(() => { | |
const SHOW_SIDES = false; // color sides of DOM nodes? | |
const COLOR_SURFACE = true; // color tops of DOM nodes? | |
const COLOR_RANDOM = false; // randomise color? | |
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
const THICKNESS = 20; // thickness of layers | |
const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
import { fileURLToPath } from 'node:url'; | |
import { describe, test } from 'vitest'; | |
import { expect } from '@playwright/test'; | |
import { setup, createPage } from '@nuxt/test-utils'; | |
describe('Landing page', async () => { | |
await setup({ | |
rootDir: fileURLToPath(new URL('..', import.meta.url)), | |
server: true, | |
browser: true, |
// excerpt from package.json | |
// "remark": "^14.0.2", | |
// "remark-link-rewrite": "^1.0.6", | |
// "shelljs": "^0.8.5", | |
function update_urls(folder, repo){ | |
console.log('Update URLs', folder, repo) | |
shelljs.ls(`${folder}*.md`).forEach(file => { | |
readFile(file, (err, fileContent)=>{ | |
remark() |
# Source: https://gist.github.com/vfarcic/8301efb15748af1da3e376b7132e519e | |
################################################################### | |
# Should We Run Databases In Kubernetes? CloudNativePG PostgreSQL # | |
# https://youtu.be/Ny9RxM6H6Hg # | |
################################################################### | |
# Additional Info: | |
# - CloudNativePG: https://cloudnative-pg.io | |
# - EDB: https://enterprisedb.com |
import { Client, createClient, dedupExchange, errorExchange, fetchExchange, ssrExchange } from '@urql/core' | |
import { ref } from 'vue' | |
import { devtoolsExchange } from '@urql/devtools' | |
import * as Session from 'supertokens-web-js/recipe/session' | |
import { authExchange } from '@urql/exchange-auth' | |
import { defineNuxtPlugin } from '#app' | |
const ssrKey = '__URQL_DATA__' | |
export default defineNuxtPlugin((nuxtApp) => { |
// Working code with Vue3 | |
// Create Folder plugin > Create file useEmitter.js | |
import { defineNuxtPlugin } from '#app' | |
import mitt from 'mitt' | |
const emitter = mitt() | |
export default defineNuxtPlugin((nuxtApp) => { | |
nuxtApp.provide('bus', { |
/* Ultra lightweight Github REST Client */ | |
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb | |
const token = 'github-token-here' | |
const githubClient = generateAPI('https://api.github.com', { | |
headers: { | |
'User-Agent': 'xyz', | |
'Authorization': `bearer ${token}` | |
} | |
}) |
/* Using a JavaScript proxy for a super low code REST client */ | |
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg | |
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3 | |
// also see https://github.com/fastify/manifetch | |
// also see https://github.com/flash-oss/allserver | |
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb | |
const createApi = (url) => { | |
return new Proxy({}, { | |
get(target, key) { |
{ | |
// Disable telemetry | |
"telemetry.telemetryLevel": "off", | |
// Zen mode | |
"zenMode.fullScreen": false, | |
"zenMode.hideTabs": true, | |
"zenMode.centerLayout": false, | |
// Theming | |
"workbench.iconTheme": "city-lights-icons-vsc", | |
"editor.fontFamily": "Dank Mono", |