Skip to content

Instantly share code, notes, and snippets.

View ManUtopiK's full-sized avatar
:octocat:
Ready to code.

Emmanuel Salomon ManUtopiK

:octocat:
Ready to code.
View GitHub Profile
@Aschen
Aschen / README.md
Last active May 28, 2024 00:24
Scrape a page and convert it to Markdown

Scrape a page and convert it to Markdown

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/

@OrionReed
OrionReed / dom3d.js
Last active July 22, 2024 08:58
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 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; // ¯\\_(ツ)_/¯
@CodeDredd
CodeDredd / landingpages.spec.ts
Created October 19, 2023 18:35
Full e2e test example with nuxt 3
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,
# 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
@productdevbook
productdevbook / urql.ts
Created March 4, 2023 18:34
Nuxt 3 urql graphql
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) => {
@ManUtopiK
ManUtopiK / useEmitter.js
Created June 27, 2022 02:57
Events emitter/listener in Nuxt 3
// 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', {
@DavidWells
DavidWells / github-proxy-client.js
Last active June 27, 2024 14:52
Full Github REST api in 34 lines of code
/* 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}`
}
})
@DavidWells
DavidWells / javascript-proxy-as-rest-client.js
Last active May 12, 2024 14:24
Using a javascript proxy as low code REST client
/* 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) {
@danielroe
danielroe / settings.json
Last active July 15, 2024 12:07
VScode settings for a minimal UI
{
// 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",