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/
// server/api/currentDate | |
import { stringify } from "devalue" | |
export default defineEventHandler(async (event) => { | |
const data = { | |
createAt: new Date(), | |
} | |
if (getHeader(event, 'Content-Type') === 'application/devalue') { | |
const dataToJSON = { |
#!/bin/bash | |
# Script to update a firewall rule in a Hetzner Firewall with your current IP address. | |
# Good if you would like to restrict SSH access only for your current IP address (secure). | |
################# | |
# WARNING: This script will overwrite all rules in the firewall rules, so make sure you | |
# added all the required rules. | |
# I use a separate firewall rule just for SSH access. | |
################# |
/** | |
* Iterable arrays chain, extended for "getLength" and "at" accessor. | |
*/ | |
export interface IArraysChain<T> extends RelativeIndexable<T>, Iterable<T> { | |
/** | |
* Calculates total length of all input arrays combined. | |
*/ | |
getLength(): number; | |
} |
// 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() |
import { | |
defineConfig, | |
presetAttributify, | |
presetIcons, | |
presetTagify, | |
presetWind, | |
transformerDirectives, | |
transformerVariantGroup, | |
} from "unocss"; | |
//import fs from "node:fs/promises"; |
# 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) => { |