Skip to content

Instantly share code, notes, and snippets.

View Konard's full-sized avatar
🖥️
Watch how I code at https://www.youtube.com/c/КонстантинДьяченко

Konstantin Diachenko Konard

🖥️
Watch how I code at https://www.youtube.com/c/КонстантинДьяченко
View GitHub Profile
#include<iostream>
using namespace std;
int foo(int n)
{
if (n == 0)
{
return 3;
}
if (n == 1)
@Konard
Konard / file.cpp
Last active January 26, 2020 10:53 — forked from epoll-reactor/file.cpp
#include<iostream>
using namespace std;
int foo1(int n)
{
if (n == 0)
{
return 3;
}
if (n == 1)
https://www.codewars.com/kata/5b16490986b6d336c900007d/train/python
def my_languages(results):
newlang = []
for key in results.keys():
if results[key] >= 60:
newlang.append({ "Key": key, "Value": results[key]})
newlang.sort(key=lambda x: x["Value"], reverse=True)
return [l["Key"] for l in newlang]
{"contents":{"editor":{"tabSize":2},"launch":{"version":"0.2.0","configurations":[{"type":"chrome","request":"launch","name":"Meteor: Chrome","url":"http://localhost:3000","webRoot":"${workspaceFolder}"},{"type":"node","request":"launch","name":"Meteor: Node","runtimeExecutable":"npm","runtimeArgs":["run","debug"],"port":9229,"timeout":999999,"console":"integratedTerminal"}]}},"overrides":[],"keys":["editor.tabSize","launch.version","launch.configurations"]}
@Konard
Konard / chatgpt-with-qa-format.js
Created December 15, 2022 12:53 — forked from shinshin86/chatgpt-with-qa-format.js
Script for displaying the conversing with ChatGPT in the console log in QA format.
// USAGE: After conversing with ChatGPT, run this code on the Chrome developer console.
const textList = []
document.querySelectorAll('.text-base').forEach((t, i) => {
textList.push(`${i % 2 === 0 ? "Q:" : "A:"} ${t.textContent}`)
})
console.log(textList.join('\n'));
@Konard
Konard / main.py
Created September 26, 2023 16:02 — forked from kalinochkind/main.py
Discord gpt bot
#!/usr/bin/env python3
import discord
import sqlite3
import datetime
import openai
import os
import tiktoken
openai.api_type = "azure"