Run the following
curl -fsSL https://claude.ai/install.sh | bash
git clone https://github.com/gavrielc/nanoclaw.git
cd nanoclaw
claude "/setup"
bailing out if any user input is necessary
Run the following
curl -fsSL https://claude.ai/install.sh | bash
git clone https://github.com/gavrielc/nanoclaw.git
cd nanoclaw
claude "/setup"
bailing out if any user input is necessary
| // On every page, run | |
| links=[...document.querySelectorAll('p a')].map(x=>x.outerHTML); | |
| page=[`<link rel="self" href=${document.location}/>`, ...links].join("\n"); | |
| localStorage.setItem("oh-links", | |
| (localStorage.getItem("oh-links") || "") + "\n\n" + page | |
| ) | |
| //Then copy out one final | |
| localStorage.getItem("oh-links") | |
| //and paste it into https://claude.ai/public/artifacts/bbb54583-0310-49d5-b3fe-54a87054b5ac |
| trait Person { | |
| fn greeting(&self) -> StateOfMind; | |
| fn name(&self) -> &'static str; | |
| } | |
| struct Ixi { } | |
| struct Katie { } | |
| #[derive(Debug)] | |
| enum StateOfMind { |
| #![feature(const_panic)] | |
| #![feature(const_in_array_repeat_expressions)] | |
| #![feature(array_map)] | |
| #![feature(untagged_unions,min_const_generics)] | |
| use std::convert::{TryInto,TryFrom}; | |
| use std::mem; | |
| use core::fmt; | |
| use core::fmt::{Debug}; |
| // Adapted from https://fabiensanglard.net/rayTracing_back_of_business_card/ | |
| #include <stdlib.h> // card > aek.ppm | |
| #include <stdio.h> | |
| #include <math.h> | |
| #include <time.h> | |
| typedef int i;typedef float f;struct v{ | |
| f x,y,z;v operator+(v r){return v(x+r.x | |
| ,y+r.y,z+r.z);}v operator*(v r){return | |
| v(x*r.x,y*r.y,z*r.z);}v operator*(f r){return | |
| v(x*r,y*r,z*r);}f operator%(v r){return |
| #!/usr/bin/env lsc | |
| {stdin, stdout} = process | |
| stdout.write "\x1b[?25l" | |
| stdin.on \data -> stdout.write "\x1b[?25h"; process.exit 0 | |
| require! \osc-js | |
| a = new oscJs plugin:new osc-js.DatagramPlugin | |
| a.open port:2222 host:0 | |
| v = -> "█"*(it*8) + " ▏▎▍▌▋▊▉█"[0.^.(it*64%8)] | |
| n=1 | |
| a.on "*" ({address:[...,a], args:[h]}) -> |
| /* | |
| - `»` and `«` to delimit indent/outdent tokens | |
| - two text areas side by side, one with »«, one without | |
| - edits to indent editor update the brackets, edits to bracket editor update indents in both to match brackets | |
| */ | |
| mnt = document.body.querySelector('div') | |
| mnt && mnt.remove() | |
| document.body.appendChild(mnt = document.createElement('div')) | |
| out.innerText=''; (new Date)+"\n"+document.body.outerHTML | |
| mnt.innerHTML = ` |
| ind = -> | |
| out = [] | |
| for line in it / \\n | |
| # line.replace /[^\s]+( [^\s]+)*/g (w,_,at)-> | |
| line.replace /[^\s]+/g (w,at)-> # actually just iterate | |
| out.push [at,w] | |
| # | |
| out | |
| ren = -> | |
| cur = 0 |
| /* | |
| - panes: input | compiler | wast | runtime | output | |
| TODO | |
| - snapshot button that saves json of [date input compiler runtime] to localStorage | |
| - timestamp buttons to cycle through old versions - also sth with diffs? | |
| - <details> on "foo =\n", w/ collapse back if backspace on beginning | |
| */ | |
| document.body.querySelector('script') || document.body.appendChild( | |
| document.createRange().createContextualFragment( | |
| '<script src=https://cdn.rawgit.com/WebAssembly/wabt/aae5a4b7/demo/libwabt.js>' |
| <body> | |
| <script src="https://code.jquery.com/jquery.js"></script> | |
| <pre id="boot" contenteditable style="background:#eea">inp.onkeyup = inp.onfocus = () => { | |
| var a | |
| try{ a = eval(inp.innerText)} catch(_a){ a = _a} | |
| res.innerText = a | |
| }</pre> | |
| <pre id="inp" contenteditable style="background:#bdb"> |