Skip to content

Instantly share code, notes, and snippets.

View muePatrick's full-sized avatar

Patrick Müller muePatrick

View GitHub Profile
function log(message) {
console.log(`[${new Date().toISOString()}] ${message}`);
}
const debouncedLog = debounce(log, 2000);
function fetch(query) {
console.log(`Fetching data for query: ${query}`);
}
@muePatrick
muePatrick / ai.sh
Last active February 29, 2024 12:10
Ask GPT for right terminal command
OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# e.g. List all docker containers and forcefully stop all the ones with with word test in their name.
read -p "I need to do the following: " USER_QUERY
GPT_MESSAGE_CONTENT="Give me a linux terminal command to do the following: $USER_QUERY. Respond with a json array of possible commands only. Each entry should be a new entry. Each entry should only contain the command. No additional text should be present. Give multiple suggestion if possible. The commands should be for linux."
GPT_REQUEST_BODY='{
"model": "gpt-4-turbo-preview",
"messages": [
// ==UserScript==
// @name Kasta+ Reader
// @namespace Kasta+ Reader
// @version 0.1
// @description Read Kasta+ Articles
// @author muePatrick
// @match https://www.ksta.de/*
// ==/UserScript==
(function() {
server:
# If no logfile is specified, syslog is used
# logfile: "/var/log/unbound/unbound.log"
verbosity: 0
interface: 127.0.0.1
port: 5335
do-ip4: yes
do-udp: yes
do-tcp: yes
@muePatrick
muePatrick / VueComponent(CompositionApi).vue
Last active November 9, 2021 09:08
VueComponentTemplates
<template>
<div class="viewRoot">
Hello World
<!-- {{someVariable}} -->
<!-- {{someComputedVariable}} -->
<!-- <SomeOtherComponent @click="someFunction" /> -->
</div>
</template>
<script>