This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Codemod: Convert YAML frontmatter in MDX files to export const metadata | |
| // Usage: node codemod-frontmatter-to-metadata.mjs | |
| // This script scans all MDX files in the content directory, extracts YAML frontmatter, | |
| // and converts it into a JavaScript export named `metadata`. | |
| // Dependencies: tinyglobby, js-yaml | |
| // Install them via: `pnpm add -D tinyglobby js-yaml` | |
| import fs from "fs" | |
| import path from "path" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type { ReactNode } from "react" | |
| import { createElement, Fragment, useEffect, useState } from "react" | |
| export const ClientOnly = ({ children }: { children: ReactNode }) => { | |
| const hasMounted = useClientOnly() | |
| if (!hasMounted) { | |
| return null | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* eslint-disable @typescript-eslint/restrict-template-expressions */ | |
| /* eslint-disable @typescript-eslint/no-unsafe-argument */ | |
| /* eslint-disable @typescript-eslint/no-unsafe-assignment */ | |
| /* eslint-disable @typescript-eslint/no-unsafe-member-access */ | |
| /* eslint-disable @typescript-eslint/no-unnecessary-condition */ | |
| "use client" | |
| import type { NameType, ValueType } from "recharts/types/component/DefaultTooltipContent" | |
| import * as React from "react" | |
| import * as RechartsPrimitive from "recharts" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // license: MIT | |
| import type { FileSystemEntry } from "renoun/file-system" | |
| import { Directory, EntryGroup, MemoryFileSystem } from "renoun/file-system" | |
| const renounFileSystem = new MemoryFileSystem({ | |
| "index.mdx": "", | |
| "01.section-title/01.introduction.mdx": "", | |
| "01.getting-started.mdx": "", | |
| "03.section-with-index/index.mdx": "", | |
| "03.section-with-index/01.introduction.mdx": "", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // user.repository.ts | |
| import { db } from "../client" | |
| import { createRepository } from "../repository" | |
| export const userRepository = createRepository({ db, table: "users", queryBuilder: db.query.users }) | |
| // session.repository.ts | |
| import { db } from "../client" | |
| import { createRepository } from "../repository" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // file: helpers/parquet.ts | |
| import { | |
| FieldDefinition, | |
| ParquetType, | |
| SchemaDefinition, | |
| } from '@dsnp/parquetjs/dist/lib/declare' | |
| import { JSONSchema4 } from 'json-schema' | |
| export function createStringField({ | |
| optional = true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // src/components/CustomImage.tsx | |
| import Image from 'next/image' | |
| import 'yet-another-react-lightbox/styles.css' | |
| import Lightbox from 'yet-another-react-lightbox' | |
| import { useState } from 'react' | |
| /** | |
| * Generates the correct asset and base path | |
| * for the gitlab pages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // /src/pages/Calendar.vue | |
| // --> http://localhost:8080/calendar | |
| <template> | |
| <div> | |
| <datetime v-model="date"></datetime> | |
| <ul> | |
| <li v-for="event in filteredList" :key="event.id"> | |
| {{ event.node.summary }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| . | |
| |-src | |
| | |-components | |
| | |-layouts | |
| | |-templates | |
| | |-assets | |
| | | |-remoteImages | |
| | | | |- image.png ( <-- my example image which is used in the code below ) | |
| | |-pages | |
| |-packages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function loadCss() { | |
| wp_enqueue_style('bootstrap', 'https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css'); | |
| } | |
| function loadJavascript() { | |
| wp_deregister_script('jquery'); | |
| wp_enqueue_script('jquery', 'https://code.jquery.com/jquery-3.5.1.slim.min.js', array(), null, true); | |
| wp_enqueue_script('popperjs', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js', array('jquery'), false, true); |
NewerOlder