diff --git a/README.md b/README.md
index 93826e6..bcd01b2 100644
--- a/README.md
+++ b/README.md
@@ -2658,6 +2658,23 @@ Contributed by: [@awesomesolution](https://github.com/awesomesolution)
> challenges to resolve complex issues and scaling the application with zero
> issues and high performance of application in low or no network as well.
+
+## Act as Devops Engineer
+
+Contributed by: [@tscburak](https://github.com/tscburak)
+
+> You are a ${Title:Senior} DevOps engineer working at
+> ${Company Type: Big Company}. Your role is to provide scalable, efficient, and
+> automated solutions for software deployment, infrastructure management, and CI/CD
+> pipelines. First problem is: ${Problem: Creating an MVP quickly for an
+> e-commerce web app}, suggest the best DevOps practices, including
+> infrastructure setup, deployment strategies, automation tools, and cost-effective
+> scaling solutions.
+
+
+
+
+
## Contributors 😍
Many thanks to these AI whisperers:
diff --git a/_layouts/default.html b/_layouts/default.html
index a875d58..6708c63 100644
--- a/_layouts/default.html
+++ b/_layouts/default.html
@@ -1347,6 +1347,59 @@
font-size: 0.9rem;
}
}
+
+ /* Variable Input Field Styles */
+ .variable-container {
+ margin-bottom: 24px;
+ padding: 16px;
+ background: rgba(16, 185, 129, 0.05);
+ border-radius: 8px;
+ border: 1px solid var(--accent-color);
+ }
+
+ .variable-form {
+ display: grid;
+ gap: 12px;
+ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
+ }
+
+ .variable-input-wrapper {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ }
+
+ .variable-input-wrapper label {
+ font-size: 0.8rem;
+ color: var(--accent-color);
+ font-weight: 500;
+ }
+
+ .variable-input {
+ padding: 8px;
+ border: 1px solid #e1e4e8;
+ border-radius: 4px;
+ font-size: 0.9rem;
+ background: var(--bg-color-light);
+ color: var(--text-color-light);
+ transition: all 0.2s ease;
+ }
+
+ .dark-mode .variable-input {
+ background: var(--bg-color-dark);
+ color: var(--text-color-dark);
+ border-color: #2d2d2d;
+ }
+
+ .variable-input:focus {
+ outline: none;
+ border-color: var(--accent-color);
+ box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
+ }
+
+ .modal-content {
+ white-space: pre-wrap;
+ }
{% include head-custom.html %}
@@ -1423,13 +1476,13 @@
- {{ content }}
+ {{ content }}
{% if site.github.private != true and site.github.license %}
-
+ {% endif %}
diff --git a/prompts.csv b/prompts.csv
index 98a4ea9..30f5d34 100644
--- a/prompts.csv
+++ b/prompts.csv
@@ -210,3 +210,4 @@ act,prompt,for_devs
"Virtual Event Planner","I want you to act as a virtual event planner, responsible for organizing and executing online conferences, workshops, and meetings. Your task is to design a virtual event for a tech company, including the theme, agenda, speaker lineup, and interactive activities. The event should be engaging, informative, and provide valuable networking opportunities for attendees. Please provide a detailed plan, including the event concept, technical requirements, and marketing strategy. Ensure that the event is accessible and enjoyable for a global audience.",FALSE
"Linkedin Ghostwriter","Act as an Expert Technical Architecture in Mobile, having more then 20 years of expertise in mobile technologies and development of various domain with cloud and native architecting design. Who has robust solutions to any challenges to resolve complex issues and scaling the application with zero issues and high performance of application in low or no network as well.",FALSE
"SEO Prompt","Using WebPilot, create an outline for an article that will be 2,000 words on the keyword 'Best SEO prompts' based on the top 10 results from Google. Include every relevant heading possible. Keep the keyword density of the headings high. For each section of the outline, include the word count. Include FAQs section in the outline too, based on people also ask section from Google for the keyword. This outline must be very detailed and comprehensive, so that I can create a 2,000 word article from it. Generate a long list of LSI and NLP keywords related to my keyword. Also include any other words related to the keyword. Give me a list of 3 relevant external links to include and the recommended anchor text. Make sure they're not competing articles. Split the outline into part 1 and part 2.",TRUE
+"Devops Engineer","You are a ${Title:Senior} DevOps engineer working at ${Company Type: Big Company}. Your role is to provide scalable, efficient, and automated solutions for software deployment, infrastructure management, and CI/CD pipelines. The first problem is: ${Problem: Creating an MVP quickly for an e-commerce web app}, suggest the best DevOps practices, including infrastructure setup, deployment strategies, automation tools, and cost-effective scaling solutions.",TRUE
\ No newline at end of file
diff --git a/script.js b/script.js
index 6c1bf1f..34eeb3e 100644
--- a/script.js
+++ b/script.js
@@ -13,6 +13,95 @@ function toggleDarkMode() {
moonIcon.style.display = isDarkMode ? "block" : "none";
}
+// Add these new functions at the top
+function extractVariables(text) {
+ const regex = /\${([^}]+)}/g;
+ const variables = [];
+ let match;
+
+ while ((match = regex.exec(text)) !== null) {
+ const [variable, defaultValue] = match[1].split(":").map((s) => s.trim());
+ variables.push({ name: variable, default: defaultValue || "" });
+ }
+
+ return [...new Set(variables.map((v) => JSON.stringify(v)))].map((v) =>
+ JSON.parse(v)
+ ); // Remove duplicates
+}
+
+function createVariableInputs(variables, container) {
+ const form = document.createElement("div");
+ form.className = "variable-form";
+
+ variables.forEach((variable) => {
+ const wrapper = document.createElement("div");
+ wrapper.className = "variable-input-wrapper";
+
+ const label = document.createElement("label");
+ label.textContent = variable.name;
+ label.style.fontWeight = "600";
+
+ const input = document.createElement("input");
+ input.type = "text";
+ input.className = "variable-input";
+ input.placeholder = variable.default || `Enter ${variable.name}`;
+ input.dataset.variable = variable.name;
+ input.dataset.default = variable.default || "";
+
+ wrapper.appendChild(label);
+ wrapper.appendChild(input);
+ form.appendChild(wrapper);
+ });
+
+ container.appendChild(form);
+ return form;
+}
+
+// Function to update the prompt preview with user input or default values
+function updatePromptPreview(promptText, form) {
+ const variables = extractVariables(promptText);
+
+ if (variables.length === 0) {
+ return promptText; // Return original text if no variables found
+ }
+
+ let previewText = promptText;
+ // Replace variables with their default values without editting (for prompt cards, copy buttons, chat)
+ if (!form) {
+ variables.forEach(variable => {
+ const pattern = new RegExp(`\\$\{${variable.name}[^}]*\}`, 'g');
+ const replacement = variable.default || `${variable.name}`;
+ previewText = previewText.replace(pattern, replacement);
+ });
+ }
+ // Replace variables according to the user inputs.
+ else {
+ const inputs = form.querySelectorAll(".variable-input");
+
+ inputs.forEach((input) => {
+ const value = input.value.trim();
+ const variable = input.dataset.variable;
+ const defaultValue = input.dataset.default;
+ const pattern = new RegExp(`\\$\{${variable}[^}]*\}`, 'g');
+ let replacement;
+ if (value) {
+ // User entered value
+ replacement = value;
+ } else if (defaultValue) {
+ // Show default value with highlight
+ replacement = defaultValue;
+ } else {
+ // No value or default, show variable name
+ replacement = variable;
+ }
+ replacement = `${replacement}`;
+
+ previewText = previewText.replace(pattern, replacement);
+ });
+ }
+ return previewText;
+}
+
// Initialize everything after DOM loads
document.addEventListener("DOMContentLoaded", () => {
// Initialize dev mode
@@ -127,11 +216,12 @@ async function initializeSearch() {
const searchTerm = e.target.value.toLowerCase();
const filteredPrompts = prompts.filter((prompt) => {
- const matchesSearch = prompt.act.toLowerCase().includes(searchTerm) ||
+ const matchesSearch =
+ prompt.act.toLowerCase().includes(searchTerm) ||
prompt.prompt.toLowerCase().includes(searchTerm);
return isDevMode
- ? (matchesSearch && prompt.for_devs === true)
+ ? matchesSearch && prompt.for_devs === true
: matchesSearch;
});
@@ -165,29 +255,32 @@ function updatePromptCount(filteredCount, totalCount) {
function parseCSV(csv) {
const lines = csv.split("\n");
- const headers = lines[0].split(",").map((header) =>
- header.replace(/"/g, "").trim()
- );
+ const headers = lines[0]
+ .split(",")
+ .map((header) => header.replace(/"/g, "").trim());
- return lines.slice(1).map((line) => {
- const values = line.match(/(".*?"|[^",\s]+)(?=\s*,|\s*$)/g) || [];
- const entry = {};
+ return lines
+ .slice(1)
+ .map((line) => {
+ const values = line.match(/(".*?"|[^",\s]+)(?=\s*,|\s*$)/g) || [];
+ const entry = {};
- headers.forEach((header, index) => {
- let value = values[index] ? values[index].replace(/"/g, "").trim() : "";
- // Remove backticks from the act/title
- if (header === "act") {
- value = value.replace(/`/g, "");
- }
- // Convert 'TRUE'/'FALSE' strings to boolean for for_devs
- if (header === "for_devs") {
- value = value.toUpperCase() === "TRUE";
- }
- entry[header] = value;
- });
+ headers.forEach((header, index) => {
+ let value = values[index] ? values[index].replace(/"/g, "").trim() : "";
+ // Remove backticks from the act/title
+ if (header === "act") {
+ value = value.replace(/`/g, "");
+ }
+ // Convert 'TRUE'/'FALSE' strings to boolean for for_devs
+ if (header === "for_devs") {
+ value = value.toUpperCase() === "TRUE";
+ }
+ entry[header] = value;
+ });
- return entry;
- }).filter((entry) => entry.act && entry.prompt);
+ return entry;
+ })
+ .filter((entry) => entry.act && entry.prompt);
}
function displaySearchResults(results) {
@@ -231,8 +324,9 @@ function displaySearchResults(results) {
// Find the prompt card with matching title
const cards = document.querySelectorAll(".prompt-card");
const targetCard = Array.from(cards).find((card) => {
- const cardTitle = card.querySelector(".prompt-title").textContent
- .replace(/\s+/g, " ") // Normalize whitespace
+ const cardTitle = card
+ .querySelector(".prompt-title")
+ .textContent.replace(/\s+/g, " ") // Normalize whitespace
.replace(/[\n\r]/g, "") // Remove newlines
.trim();
@@ -241,8 +335,10 @@ function displaySearchResults(results) {
.replace(/[\n\r]/g, "") // Remove newlines
.trim();
- return cardTitle.toLowerCase().includes(searchTitle.toLowerCase()) ||
- searchTitle.toLowerCase().includes(cardTitle.toLowerCase());
+ return (
+ cardTitle.toLowerCase().includes(searchTitle.toLowerCase()) ||
+ searchTitle.toLowerCase().includes(cardTitle.toLowerCase())
+ );
});
if (targetCard) {
@@ -262,8 +358,8 @@ function displaySearchResults(results) {
if (isMobile) {
// On mobile, scroll the window
const cardRect = targetCard.getBoundingClientRect();
- const scrollTop = window.pageYOffset + cardRect.top - headerHeight -
- 20;
+ const scrollTop =
+ window.pageYOffset + cardRect.top - headerHeight - 20;
window.scrollTo({
top: scrollTop,
@@ -273,8 +369,8 @@ function displaySearchResults(results) {
// On desktop, scroll the main-content container
const mainContent = document.querySelector(".main-content");
const cardRect = targetCard.getBoundingClientRect();
- const scrollTop = mainContent.scrollTop + cardRect.top -
- headerHeight - 20;
+ const scrollTop =
+ mainContent.scrollTop + cardRect.top - headerHeight - 20;
mainContent.scrollTo({
top: scrollTop,
@@ -315,12 +411,13 @@ function filterPrompts() {
.then((csvText) => {
const prompts = parseCSV(csvText);
const filteredPrompts = prompts.filter((prompt) => {
- const matchesSearch = !searchTerm ||
+ const matchesSearch =
+ !searchTerm ||
prompt.act.toLowerCase().includes(searchTerm) ||
prompt.prompt.toLowerCase().includes(searchTerm);
return isDevMode
- ? (matchesSearch && prompt.for_devs === true)
+ ? matchesSearch && prompt.for_devs === true
: matchesSearch;
});
@@ -329,7 +426,7 @@ function filterPrompts() {
filteredPrompts.length,
isDevMode
? prompts.filter((p) => p.for_devs === true).length
- : prompts.length,
+ : prompts.length
);
displaySearchResults(filteredPrompts);
@@ -337,23 +434,29 @@ function filterPrompts() {
const promptsGrid = document.querySelector(".prompts-grid");
if (promptsGrid) {
const cards = promptsGrid.querySelectorAll(
- ".prompt-card:not(.contribute-card)",
+ ".prompt-card:not(.contribute-card)"
);
cards.forEach((card) => {
const title = card.querySelector(".prompt-title").textContent.trim();
const matchingPrompt = prompts.find((p) => {
- const pTitle = p.act.replace(/\s+/g, " ").replace(/[\n\r]/g, "")
+ const pTitle = p.act
+ .replace(/\s+/g, " ")
+ .replace(/[\n\r]/g, "")
.trim();
- const cardTitle = title.replace(/\s+/g, " ").replace(/[\n\r]/g, "")
+ const cardTitle = title
+ .replace(/\s+/g, " ")
+ .replace(/[\n\r]/g, "")
.trim();
- return pTitle.toLowerCase() === cardTitle.toLowerCase() ||
+ return (
+ pTitle.toLowerCase() === cardTitle.toLowerCase() ||
pTitle.toLowerCase().includes(cardTitle.toLowerCase()) ||
- cardTitle.toLowerCase().includes(pTitle.toLowerCase());
+ cardTitle.toLowerCase().includes(pTitle.toLowerCase())
+ );
});
// Show card if not in dev mode or if it's a dev prompt in dev mode
card.style.display =
- (!isDevMode || (matchingPrompt && matchingPrompt.for_devs === true))
+ !isDevMode || (matchingPrompt && matchingPrompt.for_devs === true)
? ""
: "none";
});
@@ -396,23 +499,29 @@ function createPromptCards() {
const isDevMode = document.getElementById("devModeToggle").checked;
const promptElements = document.querySelectorAll(
- "h2[id^=act] + p + blockquote",
+ "h2[id^=act] + p + blockquote"
);
promptElements.forEach((blockquote) => {
- const title = blockquote.previousElementSibling.previousElementSibling
- .textContent.trim();
+ const title =
+ blockquote.previousElementSibling.previousElementSibling.textContent.trim();
const content = blockquote.textContent.trim();
// Find matching prompt in CSV
const matchingPrompt = prompts.find((p) => {
- const csvTitle = p.act.replace(/\s+/g, " ").replace(/[\n\r]/g, "")
+ const csvTitle = p.act
+ .replace(/\s+/g, " ")
+ .replace(/[\n\r]/g, "")
.trim();
- const elementTitle = title.replace(/\s+/g, " ").replace(/[\n\r]/g, "")
+ const elementTitle = title
+ .replace(/\s+/g, " ")
+ .replace(/[\n\r]/g, "")
.trim();
- return csvTitle.toLowerCase() === elementTitle.toLowerCase() ||
+ return (
+ csvTitle.toLowerCase() === elementTitle.toLowerCase() ||
csvTitle.toLowerCase().includes(elementTitle.toLowerCase()) ||
- elementTitle.toLowerCase().includes(csvTitle.toLowerCase());
+ elementTitle.toLowerCase().includes(csvTitle.toLowerCase())
+ );
});
// Extract contributor from the paragraph element
@@ -457,9 +566,9 @@ function createPromptCards() {
- ${content}
+ ${updatePromptPreview(content)}
@${contributor}
`;
@@ -496,7 +605,7 @@ function createPromptCards() {
copyButton.addEventListener("click", async (e) => {
e.stopPropagation();
try {
- await navigator.clipboard.writeText(content);
+ await navigator.clipboard.writeText(updatePromptPreview(content));
copyButton.innerHTML = `