This file contains hidden or 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> | |
<meta charset="utf-8"> | |
<title>title</title> | |
</head> | |
<body> | |
<input type="text" /> | |
<br> | |
<img/> |
This file contains hidden or 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
// edit: only convert if not already txt... | |
if (filepath.Ext(inputPath)) != ".txt" { | |
// Create a temporary file for the intermediate output | |
tmpFile, err := os.CreateTemp("", "ebook-convert-*.txt") | |
if err != nil { | |
return nil, fmt.Errorf("failed to create temporary file: %v", err) | |
} | |
defer tmpFile.Close() |
This file contains hidden or 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
-- MarI/O by SethBling | |
-- Feel free to use this code, but please do not redistribute it. | |
-- Intended for use with the BizHawk emulator and Super Mario World or Super Mario Bros. ROM. | |
-- For SMW, make sure you have a save state named "DP1.state" at the beginning of a level, | |
-- and put a copy in both the Lua folder and the root directory of BizHawk. | |
if gameinfo.getromname() == "Super Mario World (USA)" then | |
Filename = "DP1.state" | |
ButtonNames = { | |
"A", |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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" |
NewerOlder