configuration.nix
# Fonts
fonts = {
enableDefaultFonts = true;
fonts = with pkgs; [
(callPackage ../../pkgs/astigmata {} )
];
fontconfig.defaultFonts.monospace = [ "Astigmata" ];
};| const uuid4 = (): Uint8Array => { | |
| let res = crypto.getRandomValues(new Uint8Array(18)); | |
| res[6] = (res[6] & 0x0f) | 0x40; // Version 4 | |
| res[8] = (res[8] & 0x3f) | 0x80; // Variant is 10 | |
| return res | |
| }; | |
| const uuid7 = (() => { | |
| let prev = 0; | |
| return (): Uint8Array => { | |
| let res = uuid4(); |
configuration.nix
# Fonts
fonts = {
enableDefaultFonts = true;
fonts = with pkgs; [
(callPackage ../../pkgs/astigmata {} )
];
fontconfig.defaultFonts.monospace = [ "Astigmata" ];
};| function drawRectangles(gl) { | |
| // Create vertex buffer and bind it. | |
| const vertices = new Float32Array(4 * 2); | |
| const vertexBuffer = gl.createBuffer(); | |
| gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); | |
| // Create vertex shader | |
| const vertexShaderCode = ` | |
| attribute vec2 coordinates; | |
| void main(void) { |
codegen.zig
const std = @import("std");
const module = @import("./module.zig");
var __typeNameFix: [4096 * 4]u8 = undefined;
var __typeNameBuf: []u8 = __typeNameFix[0..];
fn typeName(comptime T: type) []const u8 {
const name = @typeName(T);
_ = std.mem.replace(u8, name, ".", "_", __typeNameBuf);| const std = @import("std"); | |
| const Step = std.build.Step; | |
| const Allocator = std.mem.Allocator; | |
| pub fn build(b: *std.Build) void { | |
| const target = b.standardTargetOptions(.{}); | |
| const optimize = b.standardOptimizeOption(.{}); | |
| const exe = b.addExecutable(.{ |
| import { labeled, pairs, mapA } from "@thi.ng/transducers"; | |
| import { | |
| merge, | |
| TransformableOpts, | |
| ISubscribable, | |
| Subscription, | |
| } from "@thi.ng/rstream"; | |
| import { IObjectOf, Pair } from "@thi.ng/api"; | |
| type MappedSubcribable<K, V> = { |
const std = @import("std");
const wasm_api = @import("node_modules/@thi.ng/wasm-api/zig/lib.zig");
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
pub const WASM_ALLOCATOR = gpa.allocator();
pub export fn start() i32 {
const allocator = wasm_api.allocator().?;
const page_size = 65_536;| { | |
| description = "dev shell"; | |
| inputs.nixpkgs.url = "github:nixos/nixpkgs/release-23.05"; | |
| inputs.flake-utils.url = "github:numtide/flake-utils"; | |
| inputs.zls.url = "github:zigtools/zls"; | |
| outputs = { self, nixpkgs, flake-utils, ... }@inputs: | |
| let | |
| zigpkgs = inputs.zls.inputs.zig-overlay.outputs.packages; |
| // START FRAMEWORK | |
| class Signal { | |
| state; | |
| subs; | |
| constructor(state) { | |
| this.state = state; | |
| this.subs = []; | |
| } | |
| subscribe(sub) { |
| package main | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "fmt" | |
| "sync" | |
| "time" | |
| ) |