Skip to content

Instantly share code, notes, and snippets.

View monkrus's full-sized avatar
🌊
AI Engineer

Sergei Stadnik monkrus

🌊
AI Engineer
View GitHub Profile
@monkrus
monkrus / gist:88921caceca48fcda73c3c2897700d66
Last active August 17, 2023 18:33
JFK prompt for AI chat bot
CHATBOT: https://mediafiles.botpress.cloud/4ed0559b-a9b8-4c54-ba66-704a69bff999/webchat/bot.html
PROMPT
You are JFK, the 35th President of the United States renowned for his charismatic leadership as President,
inspiring a generation with his call to public service, and for his pivotal in managing the tense Cuban Missile Crisis,
a critical moment in Cold War history.
For the purpose of this conversation, your responses will be centered around your presidential knowledge and experience.
Users will ask you questions and you`ll be provided with relevant snippets from your most famous Presidential speeches.
Your task is to answer these questions using your typical style and language as JFK.
Always answer the query directly in as few worlds as possible.
from gtts import gTTS
import os
def text_to_speech(file_path):
try:
with open(file_path, 'r') as file:
text = file.read().replace('\n', ' ')
speech = gTTS(text=text, lang='en', slow=False)
speech.save("output.mp3")
os.system("start output.mp3")
@monkrus
monkrus / Negprompt_Lora
Created April 19, 2023 21:20
Negative prompt for Stable Diffusion Lora training in alphabetic order.
3d, bad anatomy, bad proportions, bad teeth, blurry, cartoon, CGI, close up, cloned face, cropped, deformed, dehydrated, disfigured, duplicate, error, extra arms, extra fingers, extra legs, extra limbs, fused fingers, gross proportions, JPEG artifacts, long neck, low quality, lowres, malformed limbs, missing arms, missing legs, morbid, mutated hands, mutation, mutilated, out of frame, poorly drawn face, poorly drawn hands, render, semi-realist, signature, sketch, text, too many fingers, ugly, username, watermark, worst quality.
@monkrus
monkrus / Golang_channel_empty_or_not.go
Created December 26, 2022 20:08
Select statement to check if the channel is empty or not
package main
import (
"fmt"
"time"
)
func main() {
ch := make(chan int)
@monkrus
monkrus / extract_string_from_runes.go
Last active November 23, 2022 18:23
Extract string values
func getProduct(digits string) (product int64, e error) {
product = 1
for _, digit := range digits {
d, err := strconv.Atoi(string(digit))
if err != nil {
return -1, fmt.Errorf("cannot convert %v to int", digit)
}
product *= int64(d)
}
@monkrus
monkrus / Golang byte trimming.txt
Last active November 23, 2022 18:23
Golang byte trimming
package main
import (
"bytes"
"fmt"
"strings"
)
func main() {
var s string = "Hello World"
@monkrus
monkrus / ReadWriteRewriteFiles.txt
Last active July 9, 2022 18:41
Golang program to read/write/rewrite the files
// Golang program to read and write the files
package main
// importing the packages
import (
"fmt"
"io/ioutil"
"log"
"os"
)
package main
import "fmt"
func last() func(a, b int) int {
return func(c, d int) int {
return c + d
}
}
package main
import "fmt"
func last() func(a, b int) int {
first := func(c, d int) int {
return c + d
}
return first
}
package main
import "fmt"
type material func(x, y int) int
func main() {
var explosion material = func(elemX, elemY int) int {
return elemX + elemY
}