Skip to content

Instantly share code, notes, and snippets.

View Frityet's full-sized avatar
😁
I LOVE LUA! ❤️

Frityet

😁
I LOVE LUA! ❤️
View GitHub Profile
#ifndef ASYNCRT_BUILD_H
#define ASYNCRT_BUILD_H
#import <ObjFW/ObjFW.h>
#pragma clang assume_nonnull begin
@class Build;
@class BuildBase;
#import <stdio.h>
#import "AsyncRuntime.h"
#pragma clang assume_nonnull begin
@namespace(Utilities)
+ (Promise *)delayForSeconds: (OFTimeInterval)seconds onScheduler: (AsyncScheduler *)scheduler;
@end
#import "jsobjc.h"
#import "dom.generated.h"
#include <emscripten/emscripten.h>
EM_JS(void, install_demo_interop, (), {
class BaseGreeter {
constructor(name) {
this.name = name;
}
#include <stdio.h>
#include <stdint.h>
#import <ObjFW/ObjFW.h>
int
main(void)
{
void *pool = objc_autoreleasePoolPush();
OFMemoryStream *stream;
#include <type_traits>
#define $return using result =
#define $apply using apply =
template<class A, class B>
constexpr auto equals = std::is_same_v<A, B>;
template<typename T>
using call = typename T::result;
#include <cstdio>
#include <string_view>
#include <string>
#include <memory>
#include <unordered_map>
#include <typeindex>
#include <variant>
#include <optional>
#include <functional>
#include <type_traits>
#!/usr/bin/env luajit
local lfs = require("lfs")
local function fail(message)
error(message, 0)
end
local function printf(fmt, ...)
io.write(string.format(fmt, ...))
@Frityet
Frityet / fsm.lua
Last active February 3, 2026 17:41
local _tl_compat; if (tonumber((_VERSION or ''):match('[%d.]*$')) or 0) < 5.3 then local p, m = pcall(require, 'compat53.module'); if p then _tl_compat = m end end; local assert = _tl_compat and _tl_compat.assert or assert; local ipairs = _tl_compat and _tl_compat.ipairs or ipairs; local table = _tl_compat and _tl_compat.table or table
local record Sheep
_naked: boolean
_name: string
__index: Sheep
end
Sheep.__index = Sheep
-- impl Sheep
function Sheep:shear()
print(self._name, "gets a haircut!");
local interface Animal
-- Associated function signature; `Self` refers to the implementor type.
new: function(string): self
-- Method signatures; these will return a string.
name: function(self): string
noise: function(self): string
talk: function(self)
end