A z-machine (interpreter) for Infocom-era text adventure games like Zork. Runs in the browser or terminal. Features live mapping, undo/redo support, and narration/dictation.
Dependency-less Bonjour/Avahi service discovery for JavaScript. Compliant with RFC 6762 & RFC 6763.
A foreign function interface library for WebAssembly that adds support for additional types like strings, structs, and arrays. Inspired by node-ffi, but built for WebAssembly.
| import { Wrapper, Struct } from 'wasm-ffi'; |
| const Point = new Struct({ x: 'u32', y: 'u32' }); |
| const library = new Wrapper({ |
| get_point: [Point], |
| sum: ['number', ['array']] |
| compare: ['boolean', ['string', 'string']], |
| }); |
| library.fetch('main.wasm').then(() => { |
| const pt = library.get_point(); |
| library.sum(new Uint16Array([1, 2, 3])) === 6; |
| library.compare('this', 'that') === false; |
| }); |
| struct Point { |
| uint32_t x; |
| uint32_t y; |
| }; |
| export struct Point *get_point() { |
| struct Point *pt = malloc(sizeof(struct Point)); |
| pt->x = 111; |
| pt->y = 222; |
| return p; |
| } |
| export uint16_t sum(const uint16_t arr[]) { |
| uint16_t i; |
| uint16_t total = 0; |
| for (i = 0; i < 3; ++i) { |
| total += arr[i]; |
| } |
| return total; |
| } |
| export bool compare(char *a, char *b) { |
| return (strcmp(a, b) == 0); |
| } |
| #[repr(C)] |
| pub struct Point { |
| x: u32, |
| y: u32, |
| } |
| #[no_mangle] |
| pub fn get_point() -> *mut Point { |
| Box::into_raw(Box::new(Point { |
| x: 111, |
| y: 222, |
| })) |
| } |
| #[no_mangle] |
| pub fn sum(ptr: *const u16) -> u32 { |
| assert!(!ptr.is_null()); |
| let slice = unsafe { |
| std::slice::from_raw_parts(ptr, 3) |
| }; |
| slice.iter().sum() |
| } |
| #[no_mangle] |
| pub fn compare(a: *const c_char, b: *const c_char) -> bool { |
| assert!(!a.is_null()); |
| assert!(!b.is_null()); |
| let str_a = unsafe { CStr::from_ptr(a) }; |
| let str_b = unsafe { CStr::from_ptr(b) }; |
| str_a == str_b |
| } |
| class Point { |
| x: u32; |
| y: u32; |
| constructor(x: u32, y: u32) { |
| this.x = x; |
| this.y = y; |
| } |
| } |
| export function get_point(): Point { |
| return new Point(111, 222); |
| } |
| export function sum(arr: u16[]): u16 { |
| let result: u16 = 0; |
| for (let i = 0; i < arr.length; i++) { |
| result += arr[i]; |
| } |
| return result; |
| } |
| export function compare(a: string, b: string): boolean { |
| return a == b; |
| } |
A service that lets users create webhooks for incoming or forwarded email. Processed emails are sent as JSON to a registered URL, where they can be handled as normal requests.
Library to communicate with iOS devices through a wired USB connection. Device access is brokered by the usbmux daemon that comes bundled with iTunes (or libimobiledevice).
An open implementation of the JavaScript Chrome Sender API
A command line directory bookmarking tool