Skip to content

Instantly share code, notes, and snippets.

View oeway's full-sized avatar

Wei Ouyang oeway

  • Science For Life Laboratory
  • Stockholm
View GitHub Profile
<!doctype html>
<html>
<head>
<title>Todo list</title>
<style>
body {
margin: 0;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: radial-gradient(circle at top left, #1e293b, #020617);
color: #e5e7eb;

Test Results Summary for Running Claude Code in WebContainers

✅ Working Tools:

  1. File System Operations - All working perfectly: - LS - Lists directories - Read - Reads files (including images, PDFs, notebooks) - Write - Creates new files - Edit - Modifies existing files
  • MultiEdit - Multiple edits in one operation
# import micropip
# await micropip.install("hypha-artifact>=0.0.14")
# Make sure you add "hypha-artifact" to your requirements
import asyncio
import os
import sys
from hypha_artifact import AsyncHyphaArtifact
const serverUrl = "https://hypha.aicell.io"
const loginCallback = (context) => {
window.open(context.login_url);
};
async function startServer(serverUrl) {
// Log in and connect to the Hypha server
const token = await hyphaWebsocketClient.login({
@oeway
oeway / openai_server.py
Created September 9, 2024 08:05
Create OpenAI Chat Server via Hypha
import asyncio
import random
from hypha_rpc.utils.serve import create_openai_chat_server
async def text_generator(request: dict):
max_tokens = request.get("max_tokens", 50)
words = [
"hello",
"world",
@oeway
oeway / README.md
Created June 30, 2024 21:25
Python script for setting up a WebSocket proxy in Google Colab to communicate between the embedded web page with a WebSocket server.

Description for colab_websocket.js

Title: colab_websocket.js

Description: This JavaScript file implements a WebSocket client for Google Colab that facilitates communication between the Colab notebook and a WebSocket server. It includes buffer handling for binary data and a simple debug console for sending and receiving messages.

Description for colab_websocket_proxy.py

Title: colab_websocket_proxy.py

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oeway
oeway / imageUtils.py
Last active May 8, 2024 14:21
Improved image transform functions for dense predictions (for pytorch, keras etc.)
import numpy as np
import scipy
import scipy.ndimage
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage.interpolation import map_coordinates
import collections
from PIL import Image
import numbers
__author__ = "Wei OUYANG"
import sys, os
import imagej
import scyjava as sj
import argparse
import asyncio
import traceback
import numpy as np
import xarray as xr
from jpype import JOverride, JImplements
from imjoy_rpc.hypha import connect_to_server
<docs lang="markdown">
[TODO: write documentation for this plugin.]
</docs>
<config lang="json">
{
"name": "CodeInterpreter",
"type": "window",
"tags": [],
"ui": "",