This commit is contained in:
lovebird 2025-05-20 00:18:09 +02:00
parent 4a08425c24
commit bab945e40b
8 changed files with 11 additions and 127 deletions

View File

@ -23,7 +23,7 @@
"format": "unix-time"
}
],
"default": "2025-04-06T13:49:04.457Z"
"default": "2025-05-19T22:16:38.482Z"
},
"description": {
"type": "string",

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
{
"_variables": {
"lastUpdateCheck": 1743928603587
"lastUpdateCheck": 1747692994572
}
}

View File

@ -10519,5 +10519,9 @@
"image": "https://thenounproject.com/_next/static/media/row1-1-freshly-washed-batch-of-cherries-photo.3b89e0de.jpg",
"favicon": "https://thenounproject.com/favicon-32x32.png"
}
},
"%3Ca%20class=%22text-orange-600%20underline%22%20href=%22https://www.youtube.com/watch?v=4LrrFz802To": {
"isValid": false,
"timestamp": 1747693005368
}
}

View File

@ -1 +0,0 @@
{}

View File

@ -1,13 +1,13 @@
{
"model": "perplexity/sonar-deep-research",
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "Return a list of useful references, as Markdown, grouped : Articles, Books, Papers, Youtube, Software, Opensource Designs, ... Dont comment!\n\nText to process:\nThis tutorial explains the process of cutting HDPE sheets using an X-Carve CNC. \n\nWatch the full video in Spanish with subtitles [here](https://www.youtube.com/watch?v=4LrrFz802To).\n\n\nUser Location: Mexico City, Mexico\n\n### Step Instructions:\n\nMeasure the plastic sheet's height, width, and thickness. The X-Carve machine uses the CAM software Easel, which facilitates CNC milling. Easel allows you to simulate your material, and it includes HDPE two-color options in its material list.\n\n- **Metric to Imperial Conversion:** \n Height, Width, Thickness: Convert as needed, e.g., 1 cm = 0.3937 in.\n\nI'm sorry, but I'm unable to process the task given the provided parameters. Could you please provide more information or clarify your request?\n\nProceed to a vector graphics editor like Inkscape to create a vector file or download one from [The Noun Project](https://thenounproject.com).\n\nDownload the SVG file, a vector format, and import it to Easel.\n\nWith the file ready, select the desired width for carving or cutting, and proceed to initiate the cut using the wizard:\n\n- Confirm that the sheet is secure.\n- Specify the cutting bit; a 1/8 inch (3.175 mm) flat flute bit is used.\n- Set the machine's 0-0 coordinate, always selecting the lower left corner.\n- Raise the bit and activate the CNC Router.\n\nTake your glasses or object, post-process them, and then share with others.\n\nThis project can also be attempted with various CNC machines or manual tools like routers and saws, as demonstrated [here](https://youtu.be/gxkcffQD3eQ). Sharing your work and contributing to the community is encouraged.\n\nFeel free to share your ideas and comments."
"content": "Return a list of max. 10 keywords that can be used for SEO purposes, separated by commas (dont comment, just the list) : \n\nText to process:\nThis tutorial explains the process of cutting HDPE sheets using an X-Carve CNC. You can watch the full video in Spanish with subtitles ~~[here](<a class=\"text-orange-600 underline\" href=\"https://www.youtube.com/watch?v=4LrrFz802To)~~.\" target=\"_blank\" rel=\"noopener noreferrer\">youtube.com: youtube.com/watch?v=4LrrFz802To).</a>\n\n\nUser Location: Mexico City, Mexico\n\nTo measure the plastic sheet, determine its height, width, and thickness. The X-Carve machine uses the EASEL CAM Software, which is user-friendly for CNC milling. EASEL allows simulation of the material and includes HDPE 2-Colors in its material options.\n\nUse CNC clamps to secure the sheet to the table.\n\nNow proceed to your design software, such as Inkscape, to create a vector file, or download one from thenounproject.com.\n\nDownload the SVG file and import it into Easel.\n\nProceed by selecting your desired carving or cutting width and initiate the cutting [filtered]:\n\n- Ensure the sheet is securely fixed.\n- Specify the cutting bit; for this, we use a 1/8 inch (3.175 mm) flat flute bit.\n- Set the origin point at the bottom-left corner as coordinate 0-0.\n- Elevate the bit and activate the CNC Router.\n\nThen, the process begins!\n\nTake your glasses or object, complete any necessary finishing steps, and then share the results with friends and family.\n\nYou can attempt this project using various types of CNC machines or manual routers and saws. Sharing your work encourages community growth and collaboration. Please contribute your ideas and comments."
},
{
"role": "user",
"content": "USER Preferences : undefined"
"content": ""
}
],
"tools": []

View File

@ -1,119 +0,0 @@
import { JSONPath } from 'jsonpath-plus'
import pThrottle from 'p-throttle'
import pMap from 'p-map'
export type AsyncTransformer = (input: string, path: string) => Promise<string>
export type ErrorCallback = (path: string, value: string, error: any) => void
export type FilterCallback = (input: string, path: string) => Promise<boolean>
export type Filter = (input: string) => Promise<boolean>
export interface TransformOptions {
transform: AsyncTransformer
path: string
throttleDelay: number
concurrentTasks: number
errorCallback: ErrorCallback
filterCallback: FilterCallback
}
export const isNumber: Filter = async (input: string) => (/^-?\d+(\.\d+)?$/.test(input))
export const isBoolean: Filter = async (input: string) => /^(true|false)$/i.test(input)
export const isValidString: Filter = async (input: string) => !(input.trim() !== '')
export const testFilters = (filters: Filter[]): FilterCallback => {
return async (input: string) => {
for (const filter of filters) {
if (await filter(input)) {
return false;
}
}
return true;
};
};
export const defaultFilters = (filters: Filter[] = []) =>
[
isNumber, isBoolean, isValidString, ...filters
]
export async function transformObject(
obj: any,
transform: AsyncTransformer,
path: string,
throttleDelay: number,
concurrentTasks: number,
errorCallback: ErrorCallback,
testCallback: FilterCallback
): Promise<void> {
const paths = JSONPath({ path, json: obj, resultType: 'pointer' });
await pMap(
paths,
async (jsonPointer: any) => {
const keys = jsonPointer.slice(1).split('/')
await transformPath(obj, keys, transform, throttleDelay, concurrentTasks, jsonPointer, errorCallback, testCallback)
},
{ concurrency: concurrentTasks }
)
}
export async function transformPath(
obj: any,
keys: string[],
transform: AsyncTransformer,
throttleDelay: number,
concurrentTasks: number,
currentPath: string,
errorCallback: ErrorCallback,
testCallback: FilterCallback
): Promise<void> {
let current = obj
for (let i = 0; i < keys.length - 1; i++) {
current = current[keys[i]]
}
const lastKey = keys[keys.length - 1]
const throttle = pThrottle({
limit: 1,
interval: throttleDelay,
})
if (typeof lastKey === 'string' && lastKey !== '') {
try {
const newKey = isValidString(lastKey) && !isNumber(lastKey) ? await throttle(transform)(lastKey, currentPath) : lastKey
if (newKey !== lastKey) {
current[newKey] = current[lastKey]
delete current[lastKey]
}
if (typeof current[newKey] === 'string' && current[newKey] !== '') {
if (await testCallback(current[newKey], `${currentPath}/${lastKey}`)) {
current[newKey] = await throttle(transform)(current[newKey], `${currentPath}/${lastKey}`)
}
} else if (typeof current[newKey] === 'object' && current[newKey] !== null) {
await transformObject(current[newKey], transform, '$.*', throttleDelay, concurrentTasks, errorCallback, testCallback)
}
} catch (error) {
errorCallback(currentPath, lastKey, error)
}
}
}
const exampleTransformFunction: AsyncTransformer = async (input: string, path: string): Promise<string> => {
if (input === 'random') throw new Error('API error')
return input.toUpperCase()
}
export const defaultError: ErrorCallback = (path: string, value: string, error: any): void => {
// logger.error(`Error at path: ${path}, value: ${value}, error: ${error}`)
}
export const defaultOptions = (options: TransformOptions = {} as TransformOptions): TransformOptions => {
return {
transform: exampleTransformFunction,
path: options.path || '$[*][0,1,2]',
throttleDelay: 10,
concurrentTasks: 1,
errorCallback: defaultError,
filterCallback: testFilters(defaultFilters()),
...options
}
}

View File

@ -184,7 +184,7 @@ async function example() {
alt: "IMG_20200605_142311.jpg"
},
files: [],
category: {\n label: "uncategorized"\n }
category: { label: "uncategorized" }
//...truncated for brevity
};