Make a Val with rust.
Build a https://www.val.town/ val with rust. This is an example of how to compile a rust file to wasm and use it as a val.
Requires rust, wasm-pack and deno.
- Put your code in
val.rs
. - Build it.
ARG DENO_VERSION=1.42.2 | |
ARG BIN_IMAGE=denoland/deno:bin-${DENO_VERSION} | |
FROM ${BIN_IMAGE} AS bin | |
FROM frolvlad/alpine-glibc:alpine-3.13 | |
RUN apk --no-cache add ca-certificates | |
RUN addgroup --gid 1000 deno \ | |
&& adduser --uid 1000 --disabled-password deno --ingroup deno \ |
Build a https://www.val.town/ val with rust. This is an example of how to compile a rust file to wasm and use it as a val.
Requires rust, wasm-pack and deno.
val.rs
.Source for https://www.val.town/v/saolsen/example_rust_http_val For build instructions see https://gist.github.com/saolsen/d273bb1baba5e912e4dc2b187511affa For usage see https://www.val.town/v/saolsen/use_example_rust_http_val
from itertools import batched | |
def ordered(a, b) -> bool | None: | |
match a, b: | |
case int(i), int(j): | |
if i == j: | |
return None | |
return i < j | |
case list(i), list(j): |
C-b :
capture-pane -S -
C-b :
save-buffer filename.txt
https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file
target |
use rayon::prelude::*; | |
use thiserror::Error; | |
const ROWS: usize = 6; | |
const COLS: usize = 7; | |
#[derive(Debug)] | |
pub struct Connect4Action { | |
pub column: usize, | |
} |
FROM debian:stable-slim as get | |
WORKDIR /bun | |
RUN apt-get update | |
RUN apt-get install curl unzip -y | |
RUN curl --fail --location --progress-bar --output "/bun/bun.zip" "https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64.zip" | |
RUN unzip -d /bun -q -o "/bun/bun.zip" | |
RUN mv /bun/bun-linux-x64/bun /usr/local/bin/bun | |
RUN chmod 777 /usr/local/bin/bun |
ProcessGDBRemote::StartAsyncThread () | |
< 1> send packet: + | |
ProcessGDBRemote::AsyncThread (arg = 0x1498a7018, pid = 0) thread starting... | |
ProcessGDBRemote::AsyncThread (arg = 0x1498a7018, pid = 0) listener.WaitForEvent (NULL, event_sp)... | |
history[1] tid=0x0103 < 1> send packet: + | |
< 19> send packet: $QStartNoAckMode#b0 | |
< 1> read packet: + | |
< 6> read packet: $OK#9a | |
< 1> send packet: + | |
< 86> send packet: $qSupported:xmlRegisters=i386,arm,mips,arc;multiprocess+;fork-events+;vfork-events+#2e |
enum Op { | |
Noop, | |
Addx(i32), | |
} | |
fn parse<'a>(input: &'a str) -> impl Iterator<Item = Op> + 'a { | |
input.split("\n").map(|line| { | |
let mut split = line.split(" "); | |
let op = split.next().unwrap(); | |
match op { |