Skip to content

Instantly share code, notes, and snippets.

View Airbus5717's full-sized avatar
🎯
Busy

Airbus5717 Airbus5717

🎯
Busy
View GitHub Profile
### CONFIGURATION
TAKE_ACTIONS = False # If false, it has no access to terminal and code execution
USE_MEMORY = True
USE_PYTHON = True
USE_CALCULATOR = True
USE_SHELL = True
USE_WIKI_SEARCH = True
USE_SEARCH_ONLINE = True
@Airbus5717
Airbus5717 / main.py
Created February 8, 2024 11:06
Get all files in dir that end with .vtt and replace with .txt with the specific edits required
# source https://gist.github.com/glasslion/b2fcad16bc8a9630dbd7a945ab5ebf5e
import os
def find_files(directory, extension):
"""
Recursively finds all files with a specific extension in a directory and its subdirectories.
Args:
- directory (str): The directory to start the search from.
- extension (str): The file extension to search for (e.g., '.txt', '.jpg', etc.).
@Airbus5717
Airbus5717 / main.cc
Last active October 3, 2022 20:05
some random code
// MACROS AND TYPEDEFS
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <stdbool.h>
typedef unsigned int uint;
#define UNUSED(x) ((void)(x))
@Airbus5717
Airbus5717 / Vector.cpp
Last active June 3, 2023 13:55
custom Vector impl (depends on libc only)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <limits.h>
typedef size_t usize;
typedef uint8_t u8;
@Airbus5717
Airbus5717 / main.py
Created November 20, 2021 14:41
Punish
import random
import asyncio
from aiohttp import ClientSession
async def fetch(url, session):
async with session.get(url) as response:
delay = response.headers.get("DELAY")
date = response.headers.get("DATE")
print("{}:{} with delay {}".format(date, response.url, delay))
@Airbus5717
Airbus5717 / main.zig
Created September 30, 2021 20:05
Sample XPlane Hello World plugin in Zig
const std = @import("std");
const xplm = @import("xplm");
var g_window: xplm.XPLMWindowID = std.mem.zeroes(xplm.XPLMWindowID);
pub export fn draw_hello_world(in_window_id: xplm.XPLMWindowID, in_refcon: ?*c_void) callconv(.C) void {
_ = in_refcon;
_ = in_window_id;
}
@Airbus5717
Airbus5717 / main.py
Created March 19, 2021 20:57
ZipCodeCrap
convertDigits = [
['|', '|', ':', ':', ':'], #0
[':', ':', ':', '|', '|'], #1
[':', ':', '|', ':', '|'], #2
[':', ':', '|', '|', ':'], #3
[':', '|', ':', ':', '|'], #4
[':', '|', ':', '|', ':'], #5
[':', '|', '|', ':', ':'], #6
['|', ':', ':', ':', '|'], #7