Skip to content

Instantly share code, notes, and snippets.

View lovemycodesnippets's full-sized avatar

The New Stack lovemycodesnippets

View GitHub Profile
@lovemycodesnippets
lovemycodesnippets / Questions1.vue
Last active February 7, 2025 17:24
From the article "Building a Quiz App with Nuxt and Xata"
<template>
<div class="questions-ctr">
<div class="progress">
<div class="bar"></div>
<div class="status">1 out of 3 questions answered</div>
</div>
<div class="single-question">
<div class="question">Sample Question 1</div>
<div class="answers">
<div class="answer">Sample Answer 1</div>
@lovemycodesnippets
lovemycodesnippets / Footer.vue
Last active February 7, 2025 17:24
From the article "Building a Quiz App with Nuxt and Xata"
@lovemycodesnippets
lovemycodesnippets / nuxt.config.ts
Created February 7, 2025 17:09
From the article "Building a Quiz App with Nuxt and Xata"
export default defineNuxtConfig({
devtools: { enabled: true },
css: ["~/assets/css/main.css"],
app: {
head: {
charset: "utf-8",
viewport: "width=device-width, initial-scale=1",
},
},
});
@lovemycodesnippets
lovemycodesnippets / main.css
Last active February 7, 2025 17:23
From the article "Building a Quiz App with Nuxt and Xata"
]* {
box-sizing: border-box;
}
body {
font-size: 1.25rem;
font-family: sans-serif;
padding-top: 1.25rem;
background: #e6ecf1;
}
@lovemycodesnippets
lovemycodesnippets / questions.ts
Created February 7, 2025 17:04
From the article "Building a Quiz App with Nuxt and Xata"
import { getXataClient } from "~/src/xata";
const xata = getXataClient();
export default defineEventHandler(async (event) => {
const questions = await xata.db.questions.getMany();
return questions;
});
@lovemycodesnippets
lovemycodesnippets / answers.ts
Created February 7, 2025 17:03
From the article "Building a Quiz App with Nuxt and Xata"
import { getXataClient } from "~/src/xata";
const xata = getXataClient();
export default defineEventHandler(async (event) => {
const answers = await xata.db.answers.select(["*"]).getMany();
return answers;
});
import random
def get_num_dice():
"""Asks user for number of dice, continues asking if invalid."""
while True:
try:
num_dice = int(input("How many dice would you like to roll? "))
if num_dice < 1:
print("Please enter a positive integer.")
curl -fsSL "https://windsurf-stable.codeiumdata.com/wVxQEIWkwPUEAGf3/windsurf.gpg" | sudo gpg --dearmor -o /usr/share/keyrings/windsurf-stable-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/windsurf-stable-archive-keyring.gpg arch=amd64] https://windsurf-stable.codeiumdata.com/wVxQEIWkwPUEAGf3/apt stable main" | sudo tee /etc/apt/sources.list.d/windsurf.list > /dev/null
@lovemycodesnippets
lovemycodesnippets / LMD Crontab entry
Created January 29, 2025 20:05
From the post "Linux Security: Scan your Servers for Rootkits with ease"
0 0 * * * maldet -a / > /dev/nul 2>&1
00 00 * * * /usr/sbin/chkrootkit 2>&1 | mail -s "chkrootkit Reports of My Server" EMAIL