Skip to content

Instantly share code, notes, and snippets.

View jschyz's full-sized avatar

huihui jschyz

View GitHub Profile
@jschyz
jschyz / claude_3.5_sonnet_artifacts.xml
Created July 25, 2024 05:40 — forked from dedlim/claude_3.5_sonnet_artifacts.xml
Claude 3.5 Sonnet, Full Artifacts System Prompt
<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
@jschyz
jschyz / randomSort.js
Last active February 20, 2017 05:21
random sort, true randomness. by https://www.random.org/
function randomSort(source) {
if (!Array.isArray(source) || Array.isArray(source) && source.length < 2) {
return Promise.resolve(source)
}
var max = source.length,
set = new Set(),
url = `https://www.random.org/integers/?num=1&min=0&max=${max-1}&col=1&base=10&format=plain&rnd=new`
return new Promise(resolve => {
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person