Skip to content

Instantly share code, notes, and snippets.

@aNNiMON
aNNiMON / .usage.own
Last active September 18, 2024 20:17
OpenAI API
include "own-modules/openai/OpenAI.own"
OPENAI_API_KEY = getenv("OPENAI_API_KEY", "")
if OPENAI_API_KEY.isEmpty() {
println "OPENAI_API_KEY is required"
exit(1)
}
openai = new OpenAI(OPENAI_API_KEY)
extract(isOk, response) = openai.chatCompletionsBasic(
@aNNiMON
aNNiMON / .gitignore
Last active September 19, 2024 13:24
LutGen Nim
bin
*.sh
@aNNiMON
aNNiMON / .gitignore
Last active July 29, 2023 15:00
PicSorter
__pycache__
.idea
input
library
logs
images.db
@aNNiMON
aNNiMON / .gitignore
Last active February 17, 2024 17:59
Telefeed RSS
*.pyc
config.yml
feed.db
@Override
public void processUpdates(List<Update> updates) {
for (Update update : updates) {
processUpdate(update);
}
}
private void processUpdate(Update update) {
if (update == null) {
return;
@Override
public void processUpdates(List<Update> updates) {
for (Update update : updates) {
if (update != null) {
Message message = update.getMessage();
// don't process old messages
long current = System.currentTimeMillis() / 1000;
if (message.getDate() + 60 >= current) {
long chatId = message.getChatId();
if (chatId == config.tournamentChat()) {
@aNNiMON
aNNiMON / .covid-tool.md
Last active November 12, 2020 10:33
Daily statistics per region in Ukraine

covid-tool

Daily statistics per region in Ukraine

@aNNiMON
aNNiMON / .AudioDL.md
Last active September 26, 2022 10:16
AudioDL

AudioDL

Downloads music from Telegram to specified directory

use okhttp, http, json
class TelegramBot {
def TelegramBot(token) {
this.token = token
this.client = okhttp.newClient()
.callTimeout(6, "minutes")
.connectTimeout(5, "minutes")
.readTimeout(5, "minutes")
.build()
@aNNiMON
aNNiMON / .gitignore
Last active July 15, 2024 13:26
Reddit Images to Telegram
own-modules
main_*.own
redditimages.db