Skip to content

Instantly share code, notes, and snippets.

View SMUsamaShah's full-sized avatar
🎯
Focusing ... almost

Muhammad Usama SMUsamaShah

🎯
Focusing ... almost
View GitHub Profile
@SMUsamaShah
SMUsamaShah / claude_3.5_sonnet_artifacts.xml
Last active July 21, 2024 20:15 — forked from dedlim/claude_3.5_sonnet_artifacts.xml
Claude 3.5 Sonnet, Full Artifacts System Prompt (Updated) + markdown code blocks inside artifact tag (to use in other chat clients)
<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
@SMUsamaShah
SMUsamaShah / getTitleNative.js
Last active January 9, 2023 18:10 — forked from jbinto/getTitleNative.js
Get title from remote HTML URL - without jQuery
// Only using native browser features (no jQuery).
// Uses `fetch`, `DOMParser` and `querySelectorAll`.
const getTitle = (url) => {
return fetch(url)
.then((response) => response.text())
.then((html) => {
const doc = new DOMParser().parseFromString(html, "text/html");
const title = doc.querySelectorAll('title')[0];
return `${url}, ${title.innerText}`;
@SMUsamaShah
SMUsamaShah / task_graph.groovy
Last active February 16, 2021 18:36 — forked from jrodbx/task_graph.groovy
Graphviz visualization of a Gradle project's task graph
gradle.taskGraph.whenReady {
println "rootProject: " + rootProject.name
println "childProjects: " + rootProject.childProjects
def dot = new File(rootProject.buildDir, 'project.dot')
dot.delete()
def command = "./gradlew " + gradle.startParameter.getTaskNames().join(" ")
println "command: " + command