Skip to content

Instantly share code, notes, and snippets.

View leostera's full-sized avatar
🛠️
ars longa vita brevis

Leandro Ostera leostera

🛠️
ars longa vita brevis
View GitHub Profile
@leostera
leostera / miniriot.ml
Last active January 22, 2024 15:50
miniriot.ml
let sample_fun () =
Format.printf "creating fragmented data\r\n%!";
let make_data () =
let smol_array = Array.make 1000 "" in
let big_array = Array.make 1000 "" in
for i = 0 to 999 do
if i mod 2 = 0 then smol_array.(i) <- String.make 1 'h'
else big_array.(i) <- String.make 500_000 'x'
done;
smol_array
import React, { useState, useCallback, useMemo} from 'react';
import ReactFlow, {
ReactFlowProvider,
useNodesState,
useEdgesState,
addEdge,
useReactFlow,
Handle, Position,
} from 'react-flow-renderer';
type QueueOpts = {
maxConcurrency: Number;
};
type Task<R> = () => Promise<R>;
class ConcurrentQueue<R> {
opts: QueueOpts = {
maxConcurrency: 1
};
open Cmdliner
(* our echo function just prints stuff out *)
let echo x = print_string x
(* this is our argument *)
let msg = Arg.(value & pos 0 string "" & info [])
(* this is our program *)
let echo_t = Term.(const echo $ msg)
[[erlang_library]]
name = "lib"
deps = [ "//a:lib" ]
[[erlang_application]]
name = "b_app"
config = "b.app.src"
deps = [ ":lib" ]
[[otp_release]]
use super::archive::Archive;
use super::IntoToolchainBuilder;
use super::ToolchainBuilder;
use anyhow::{anyhow, Context};
use log::debug;
use std::collections::HashMap;
use std::collections::HashSet;
use std::io::{BufRead, BufReader, Write};
use std::path::PathBuf;
use std::process::{Command, Stdio};
use anyhow::*;
use std::collections::HashMap;
use std::collections::HashSet;
use std::path::PathBuf;
use zap_core::{Action, Artifact, ComputedTarget, Label, Rule, Target, ToolchainManager};
use zap_toolchains::ErlangToolchain;
#[derive(Debug, Clone)]
pub struct ErlangLibrary {
label: Label,
.file ""
.section .rodata.cst8,"a",@progbits
.align 16
caml_negf_mask:
.quad 0x8000000000000000
.quad 0
.align 16
caml_absf_mask:
.quad 0x7fffffffffffffff
.quad -1
use anyhow::{anyhow, Context, Error};
use std::fmt;
mod ffi;
#[derive(Clone, Debug)]
pub enum Sexp {
Atom(String),
List(Vec<Sexp>),
Nil,
use anyhow::{anyhow, Context, Error};
use std::fmt;
mod ffi;
#[derive(Clone, Debug)]
pub enum Sexp {
Atom(String),
List(Vec<Sexp>),
Nil,