Skip to content

Instantly share code, notes, and snippets.

View Wigny's full-sized avatar

Wígny Almeida Wigny

View GitHub Profile
@Wigny
Wigny / cloudflare-markdown.md
Last active April 8, 2026 19:52
Claude skills
Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 2 column 106
---
name: cloudflare-markdown
description: Fetch web pages as Markdown using Cloudflare's native content negotiation by sending `Accept: text/markdown` via the curl MCP tool. Trigger this skill whenever the user asks to open/read/extract/summarize content from a web link. Always try this first before any other fetch method. Falls back to markdown-new skill if the response is not Markdown.
version: 1.0.0
---

Markdown Fetch via Cloudflare Content Negotiation

Fetch URL content as structured Markdown by requesting it natively from the server using HTTP content negotiation.

// https://github.com/microsoft/monaco-editor/blob/v0.38.0/samples/browser-esm-esbuild/index.js
import * as monaco from "monaco-editor";
self.MonacoEnvironment = {
getWorkerUrl: (moduleId, label) => {
switch (label) {
case "json":
return "/admin/assets/monaco-editor/esm/vs/language/json/json.worker.js";
Application.put_env(:example, Example.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 5001],
server: true,
adapter: Bandit.PhoenixAdapter,
render_errors: [formats: [html: Example.ErrorHTML], layout: false],
live_view: [signing_salt: "aaaaaaaa"],
secret_key_base: String.duplicate("a", 64)
)
Application.put_env(:phoenix, :json_library, JSON)
import { useEffect, useState } from 'react';
import { type Duration } from 'dayjs/plugin/duration';
import { throttle } from 'lodash-es';
const events: Array<keyof DocumentEventMap> = [
'mousemove',
'keydown',
'wheel',
'mousedown',
'touchstart',
import { useSyncExternalStore, useMemo } from 'react';
export const useDocumentVisibility = (): boolean => {
const subscribe = useMemo(() => {
return (callback: () => void) => {
document.addEventListener('visibilitychange', callback);
return () => document.removeEventListener('visibilitychange', callback);
};
}, []);
import { useCallback, useSyncExternalStore } from 'react';
export function useLocalStorage<T>(key: string): [T | null, (value: T | null) => void] {
const onValueChange = useCallback(
(callback: () => void) => {
const handler = (event: StorageEvent) => {
if (event.storageArea === window.localStorage && event.key === key) callback();
};
window.addEventListener('storage', handler);
import { useLayoutEffect } from 'react';
import { duration } from 'dayjs';
import { type Duration } from 'dayjs/plugin/duration';
export function useAnimationFrame(callback: (deltaTime: Duration) => void): void {
useLayoutEffect(() => {
let requestID: number;
let previousTime = 0;
const tick = (time: number) => {
import { useSyncExternalStore } from 'react';
function onHashChange(callback: () => void) {
window.addEventListener('hashchange', callback);
return () => window.removeEventListener('hashchange', callback);
}
function getHash() {
return window.location.hash.slice(1) || null;
}
import { useCallback, useRef } from 'react';
import { duration } from 'dayjs';
import { type Duration } from 'dayjs/plugin/duration';
type Timer = {
start: () => void;
pause: () => Duration;
resume: () => void;
reset: () => void;
};
Mix.install([
{:bandit, "~> 1.6"},
{:phoenix, "~> 1.7.0"},
{:phoenix_live_view, "~> 1.0.10"},
{:phoenix_ecto, "~> 4.6"},
{:ecto_sql, "~> 3.12"},
{:postgrex, ">= 0.0.0"},
{:testcontainers, "~> 1.12"}
])