This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Microsoft Corporation. | |
// Licensed under the MIT License. | |
/** | |
* Demonstrates how to get chat completions for a chat context. | |
* | |
* @summary get chat completions. | |
*/ | |
import { AzureOpenAI } from "openai"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM oven/bun:alpine AS base | |
# Stage 1: Install dependencies | |
FROM base AS deps | |
WORKDIR /app | |
COPY package.json bun.lockb ./ | |
RUN bun install --frozen-lockfile | |
# Stage 2: Build the application | |
FROM base AS builder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oke, jadi Anda masih ingin berbicara tentang Mars. Baik. Mari kita bayangkan bahwa kurangnya medan magnet Mars entah bagaimana bukanlah masalah. Apakah Anda ingin mencoba mensimulasikan seperti apa kehidupan di Mars? Langkah pertama adalah membersihkan freezer Anda. Langkah kedua adalah mengunci diri Anda di dalamnya. (Anda dapat membawa ponsel Anda, jika Anda suka!) Ketika Anda merasa sangat lapar, orang yang Anda cintai di luar dapat mengantarkan makanan kepada Anda paling cepat sembilan bulan setelah Anda memintanya. Penantian sembilan bulan ini juga akan berlaku ketika Anda mulai menggedor bagian dalam freezer, memohon untuk dilepaskan. | |
Selamat: Anda sekarang telah mensimulasikan—Anda sekarang telah mati, dengan mengerikan, dalam satu atau dua hari, saat mensimulasikan—seperti apa kehidupan di Mars, setelah Anda memecahkan masalah tidak adanya satu tarikan napas pun udara untuk bernapas, di mana pun di seluruh planet. Kita tidak akan pernah hidup di Mars. | |
Mari kita bahas masalah udara yang dapat dihiru |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
podman login registry.gitlab.com | |
podman build --ulimit=nofile=131072:1048576 -t registry.gitlab.com/<gitlab username>/<repo name on gitlab> . | |
podman push registry.gitlab.com/<gitlab username>/<repo name on gitlab> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.8" | |
services: | |
pihole: | |
container_name: pihole | |
image: iloveitaly/pihole-scheduled-blocking:latest | |
restart: always | |
environment: | |
TZ: "America/Denver" # Put your own timezone here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Groq from "groq-sdk"; | |
const groq = new Groq({ | |
apiKey: "" | |
}); | |
export async function generate(text:string) { | |
const completion = await groq.chat.completions.create({ | |
messages: [ | |
{ | |
role: "system", | |
content: "you're summary generator create a summary of this markdown in a tweet style" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import addJobToQueue from "~/utils/bullmq/queue"; | |
const imageBuffer = fs.readFileSync( | |
path.resolve("./src/media/sorry.png"), | |
); | |
export const onGet: RequestHandler = async ({ params, send }) => { | |
const fileName = path.resolve("./src/media/" + params.id); | |
try { | |
const data = { jobName: "create-image", id: params.id }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// addJobToQueue.ts | |
import { Queue } from "bullmq"; | |
import { CONNECTOR, DEFAULT_REMOVE_CONFIG } from "./config"; | |
import setUpWorker from "./worker"; | |
import {Redis} from "ioredis"; | |
let ready=false; | |
// @ts-ignore | |
let myQueue; | |
// @ts-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// addJobToQueue.ts | |
import { Queue } from "bullmq"; | |
import { CONNECTOR, DEFAULT_REMOVE_CONFIG } from "./config"; | |
import setUpWorker from "./worker"; | |
import Redis from "ioredis"; | |
const connection = new Redis(CONNECTOR as any); | |
const myQueue = new Queue("JOBS", { connection }); | |
myQueue.on("error", () => { | |
connection.disconnect(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GoogleGenerativeAI } from "@google/generative-ai"; | |
import dotenv from 'dotenv'; | |
import { execSync } from 'child_process' | |
dotenv.config(); | |
import ky from 'ky'; | |
const API_KEY = process.env.GOOGLE_API_KEY; // Replace with your actual API key | |
const systemMessage=`You are a commit message generator by creating exactly one commit message by the diff strings without adding unnecessary information! Here is the format of a good commit message from https://karma-runner.github.io/6.4/dev/git-commit-msg.html guides: | |
--- |
NewerOlder