This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use macroquad::prelude::*; | |
#[macroquad::main("BasicShapes")] | |
async fn main() { | |
rand::srand(macroquad::miniquad::date::now() as _); | |
let w = 400; | |
let h = 400; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
#include <float.h> | |
int main() { | |
const double PI = 3.141592653589793; | |
double m = 1; | |
double n = 1; | |
// double max_m = 10000; | |
// double max_n = 10000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const w4 = @import("wasm4.zig"); | |
// actual render resolution | |
const SCREEN_SIZE = w4.SCREEN_SIZE; | |
// game resolution (everything is rendered 2x) | |
// const SCREEN_WIDTH = 48*2; | |
const SCREEN_WIDTH = 96; | |
const SCREEN_HEIGHT = SCREEN_SIZE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>sprite font</title> | |
<style> | |
body{ | |
background-color: gray; | |
margin: 0; | |
padding: 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#ifdef _WIN32 | |
#define WIN32_LEAN_AND_MEAN // prevent import of WinSock ? (conflict with WinSock2) | |
#include <windows.h> // sleep() | |
#define sleep(n) Sleep((n) * 1000) | |
#include <winsock2.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
import openai | |
import tiktoken | |
import gradio as gr | |
openai.api_key = os.getenv("OPENAI_API_KEY") | |
USE_GPT4 = False | |
OPENAI_MODEL = "gpt-4" if USE_GPT4 else "gpt-3.5-turbo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# credit goes to https://github.com/synesthesiam/magicpy | |
# Instructions: Texture image MUST be as tall as depth map (taller should work too), | |
# and 1/8th of its width (or thereabouts -- any width will work but might not look too good). | |
from PIL import Image | |
if __name__ == '__main__': | |
depth_file = "depth.jpg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import openai | |
import os | |
import asyncio | |
import aiohttp | |
import random | |
OPENAI_API_KEY = os.environ['OPENAI_API_KEY'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import subprocess | |
if len(sys.argv) < 2: | |
print("Please provide a YouTube video URL as the first argument.") | |
sys.exit(1) | |
video_url = sys.argv[1] | |
command = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import openai | |
prompt = "I'm a busy CEO, please summarize the following in 10-20 bullet points. Include only the most important, useful or interesting information.\n\n" | |
# model = 'gpt-3.5-turbo' # 'gpt-4' # moved to gpt_chat_completion since we use both | |
CONTEXT_SIZE = 4096 # 2048 for GPT-3 (as half the input. | |
# CONTEXT_SIZE = 1024 # tiny context for testing | |
MAX_TOKENS_IN = int(CONTEXT_SIZE*2/3) | |
MAX_TOKENS_OUT = CONTEXT_SIZE - MAX_TOKENS_IN |
NewerOlder