Skip to content

Instantly share code, notes, and snippets.

# set your OPENAI_API_KEY in your .env
from openai.types.chat import ChatCompletionMessageParam
from mirascope.openai import OpenAICall
from dotenv import load_dotenv
load_dotenv()
class Librarian(OpenAICall):
prompt_template = """
SYSTEM: You are the world's greatest librarian.
MESSAGES: {history}
@maxlapshin
maxlapshin / capture_raw_frames.c
Created September 30, 2011 11:50
v4l2 capture example
/*
* V4L2 video capture example
*
* This program can be used and distributed without restrictions.
*
* This program is provided with the V4L2 API
* see http://linuxtv.org/docs.php for more information
*/
#include <stdio.h>
@gagarine
gagarine / fish_install.md
Last active April 28, 2024 08:27
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 28, 2024 08:27
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@tatsumoto-ren
tatsumoto-ren / subs.md
Last active April 28, 2024 08:24
Japanese Subtitles
@Ashlyn-Joshy
Ashlyn-Joshy / expressError.js
Created April 28, 2024 08:20
Custom errors with node and express
class ExpressError extends Error {
constructor(message, status) {
super();
this.message = message;
this.status = status;
}
}
module.exports = ExpressError;

Comparing usage of Ash & Ecto

# https://gist.github.com/Gazler/b4e92e9ab7527c7e326f19856f8a974a

Application.put_env(:phoenix, :json_library, Jason)

Application.put_env(:sample, SamplePhoenix.Endpoint,
  http: [ip: {127, 0, 0, 1}, port: 5001],
  server: true,
@svmihar
svmihar / scrape_kompas.py
Last active April 28, 2024 08:21
scrape seluruh paragraf berita yang ada di indeks.kompas.com
from bs4 import BeautifulSoup
import requests
# url = 'https://indeks.kompas.com/'
# url='https://indeks.kompas.com/all/2019-04-01/2'
url = 'https://indeks.kompas.com/all/2019-04-01/3'
req = requests.get(url)
# print(req.text)
@fnky
fnky / ANSI.md
Last active April 28, 2024 08:18
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@rxaviers
rxaviers / gist:7360908
Last active April 28, 2024 08:16
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue: