Skip to content

Instantly share code, notes, and snippets.

import { markdownToBlocks } from '@tryfabric/martian';
import { NotionToMarkdown } from 'notion-to-md';
@Controller('/api/tools')
export class ToolsController {
@Post('/markdown-notion')
async convert(@Body() body) {
return markdownToBlocks(body.markdown);
}
<?php
require_once('../gpt3turbo.php');
$question = 'what Buddha said about happines?';
// wyciągamy słowa kluczowe
$keywords = $gpt3->query('return up to 2 keywords (only nouns) separated by spaces for this sentence: '.$question);
// jeśli GPT użyje kropki lub przecinka jako spearatora, to zmieniamy go na spację
$keywords = preg_replace('/[,.]+/',' ',$keywords);
print("hello")
#If WinActive("ahk_exe msedge.exe")
^+y::
Clipboard := ""
Send ^l
Sleep, 50
Send ^c
ClipWait, 2
if ErrorLevel
{
MsgBox, Failed to copy URL.
tell application "System Events"
set frontmostApplication to name of first application process whose frontmost is true
set browserName to ""
if frontmostApplication is "Arc" then
tell application "Arc" to return URL of active tab of window 1
else if frontmostApplication is "Google Chrome" then
tell application "Google Chrome" to return URL of active tab of window 1
else if frontmostApplication is "Brave Browser" then
tell application "Brave Browser" to return URL of active tab of window 1
tell application "System Events"
set frontmostApplication to name of first application process whose frontmost is true
set browserName to ""
if frontmostApplication is "Arc" then
tell application "Arc" to return title of active tab of window 1
else if frontmostApplication is "Google Chrome" then
tell application "Google Chrome" to return title of active tab of window 1
else if frontmostApplication is "Brave Browser" then
tell application "Brave Browser" to return title of active tab of window 1
@iceener
iceener / gpt3.sh
Created April 28, 2023 08:54
CURL GPT-3
curl -s <https://api.openai.com/v1/completions> \\
-H "Content-Type: application/json" \\
-H "Authorization: Bearer $OPENAI_API_KEY" \\
-d '{
"model": "text-davinci-003",
"prompt": "Hello",
"temperature": 0.7,
"max_tokens": 256,
"top_p": 1,
"frequency_penalty": 0,
@iceener
iceener / remote.js
Created April 22, 2023 18:48
Keyboard Maestro Remote Action
/opt/homebrew/bin/node -e "(async () => {const response = await fetch('$KMVAR_webhook', {method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify($KMVAR_json)});const json = await response.json();console.log(JSON.stringify(json));})()"
@iceener
iceener / encoder.js
Last active July 9, 2023 18:50
gpt-3-encoder-netlify-function.js
const { encode } = require('@nem035/gpt-3-encoder')
exports.handler = async (event, context) => {
if (event.httpMethod === 'POST') {
try {
const payload = JSON.parse(event.body);
const text = payload.text;
return {
const API_URL = "https://api.openai.com/v1/chat/completions";
const MAX_TOKENS = 1500;
const TEMPERATURE = 0.5;
const SYSTEM_PROMPT = 'Act as assistant';
const MESSAGES = ["hello", "hi!", "how are you?"];
async function openAICompletion(msg) {
const options = {
method: "POST",
headers: {