BYO-UI. No CSS necessary. Inspired by react-table.
const {
getLeftNavProps,
getRightNavProps,
<artifacts_info> | |
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity. | |
# Good artifacts are... | |
- Substantial content (>15 lines) | |
- Content that the user is likely to modify, iterate on, or take ownership of | |
- Self-contained, complex content that can be understood on its own, without context from the conversation | |
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations) | |
- Content likely to be referenced or reused multiple times |
# Testing process to expand k8s PVCs without losing data | |
#region Install | |
# Check the current cluster | |
kubectl config current-context | |
# Add bitnami repo | |
helm repo list | |
helm repo add bitnami https://charts.bitnami.com/bitnami |
// @ts-nocheck //TODO: enable remove once there are typings in place | |
// TODO: uncomment all three eslint() occurrences once eslint warnings and errors are fixed | |
// for info on emitCSS etc. https://github.com/rollup/rollup-plugin-svelte#extracting-css and https://svelte.dev/docs#svelte_preprocess | |
// import { eslint } from 'rollup-plugin-eslint' | |
import { terser } from 'rollup-plugin-terser' | |
import babel from 'rollup-plugin-babel' | |
import commonjs from 'rollup-plugin-commonjs' | |
import config from 'sapper/config/rollup.js' | |
import environmentVariables from './config/env' |
import * as React from "react"; | |
type ThemeConfig = "system" | "light" | "dark"; | |
type ThemeName = "light" | "dark"; | |
// Custom themes are keyed by a unique id. | |
type KeyedThemes = { | |
[k: string]: { | |
config: ThemeConfig; | |
themeName: ThemeName; | |
}; |
Image.js
from the source below (it is almost a copy of Image.js from tiptap-extensions
except that it has a constructor that accepts uploadFunc
(function to be called with image
being uploaded) and additional logic if(upload) { ... } else { ... previous base64 logic .. }
in the new Plugin
section.import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'
/**
* Matches following attributes in Markdown-typed image: [, alt, src, title]
*
const canvasSketch = require('canvas-sketch'); | |
const { renderPaths, createPath, pathsToPolylines } = require('canvas-sketch-util/penplot'); | |
const { clipPolylinesToBox } = require('canvas-sketch-util/geometry'); | |
const Random = require('canvas-sketch-util/random'); | |
const settings = { | |
dimensions: [ 12, 12 ], | |
orientation: 'landscape', | |
pixelsPerInch: 300, | |
scaleToView: true, |
// License: Polyform Non Commercial 1.0.0 | |
// https://polyformproject.org/licenses/noncommercial/1.0.0/ | |
const canvasSketch = require('canvas-sketch'); | |
const Random = require('canvas-sketch-util/random'); | |
const Color = require('canvas-sketch-util/color'); | |
const { linspace, lerp } = require('canvas-sketch-util/math'); | |
const risoColors = require('riso-colors').map(h => h.hex).filter(c => { | |
const hex = Color.parse(c).hex.toLowerCase(); | |
return hex !== '#000000' && hex !== '#ffffff' | |
}); |
// We'll use an npm module here (probably won't be possible in the Figma plugin...) | |
import triangulate from 'delaunay-triangulate'; | |
// Export your generative program | |
export default { | |
props: { | |
// Number of points (e.g. 1D data structure) | |
shape: 125 | |
}, | |
// Here the 'vertex' shader generates random points in 2D |
package main | |
import ( | |
"crypto/rand" | |
"flag" | |
"log" | |
mrand "math/rand" | |
"net" | |
"os" | |
"os/signal" |