Skip to content

Instantly share code, notes, and snippets.

View mimoo's full-sized avatar
🦀
求同存异

David Wong mimoo

🦀
求同存异
View GitHub Profile

Give vscode agent mode the power to do web searches

You need uv, then:

  1. add websearch.py to some folder FOLDER
  2. add the file .vscode/mcp.json if it doesn't exist, with your new websearch MCP server (and edit the FOLDER part). You can also do this by fuzzy searching for "MCP: Add Server" and adding the command uv --directory FOLDER run python websearch.py --stdio in the prompt.
  3. in the mcp.json you might want to put the full path to you uv instead of just uv. (do which uv in your terminal to get that full path)
  4. voila
@mimoo
mimoo / README.md
Last active April 10, 2025 14:49
Running 32-bit Rust binaries in Docker containers on MacOS

Need to test some Rust program in a 32-bit environment? You're on MacOS? Looks like you're going to have to use Docker. Not only that, but you'll have to use Docker with a 64-bit linux environment, that can support building and running 32-bit binaries.

Create this Dockerfile:

FROM rust:latest

# Ensure we don't use our local build folder
ENV CARGO_TARGET_DIR=/tmp/target32
@mimoo
mimoo / checks.rs
Created March 5, 2025 17:34
protostar
use super::acc_prover::PowersOfBeta;
use crate::equations::{Exp, Variable};
use std::{collections::HashMap, sync::Arc};
/// A check in protostar.
/// We assume that it is given in a list of homogeneous polynomials,
/// starting at degree 0 and strictly increasing by 1.
#[derive(Clone)]
pub enum Check<F, V> {
/// Either a list of homogeneous polynomials from deg0 strictly increasing,
@mimoo
mimoo / privacy-pools-ceremony_attestation.log
Created February 28, 2025 04:31
Attestation for Privacy Pools Ceremony MPC Phase 2 Trusted Setup ceremony
Hey, I'm mimoo-1316043 and I have contributed to the Privacy Pools Ceremony.
The following are my contribution signatures:
Circuit # 1 (withdraw)
Contributor # 436
Contribution Hash: 33e198db c6abcfda 6f23973a bc2f731f
c2e3918a dc67f371 444d85dd 82c11e0c
fcf9c33a 6b97e20d 3165594e 7b787423
0795fb73 5b5ed0af c82cb5a0 0b988823
@mimoo
mimoo / what_is_it.md
Created February 27, 2025 02:58
openAI API

Chat completion API is not JSON parsable

I'm trying to address two problems here:

  • how do you extend the messages with an assistant's answers?
  • what is the format of the messages

Format of messages

Let's answer the second question first. The format given by the playground, using the /v1 API, is to have a content object:

@mimoo
mimoo / aptos-keyless-jan25-iteration_attestation.log
Created January 29, 2025 00:11
Attestation for aptos-keyless-jan25-iteration MPC Phase 2 Trusted Setup ceremony
Hey, I'm mimoo-1316043 and I have contributed to the aptos-keyless-jan25-iteration MPC Phase2 Trusted Setup ceremony.
The following are my contribution signatures:
Circuit # 1 (main)
Contributor # 21
Contribution Hash: 32e63097 038d186a f662af15 d40dba11
364db47a 7c629b09 47c96326 ee76aeeb
0b912a34 b8a2d818 4b756a04 da4e889a
00b1e7a0 afd4c305 6c2e20bb fb88dc3f
@mimoo
mimoo / whoop_rem.py
Created January 11, 2025 03:00
Parse your whoop data to analyze your REM sleep
import argparse
import pandas as pd
from typing import Optional
from pydantic import BaseModel, field_validator, ValidationError
from datetime import datetime
# Define the Pydantic model for sleep data
class SleepData(BaseModel):
cycle_start_time: datetime | None
@mimoo
mimoo / recs.md
Created December 31, 2024 23:34
The recommendation list

Humor

  • all the Bo Burnham standups + inside, some of it is genius and it's hard to categorize it as humor. Inside is a masterpiece that has nothing to do with his other stand ups.

Gaming

  • The Last of Us: Part 1
  • Hunt Showdown

Movies

@mimoo
mimoo / json_serde.md
Created October 24, 2024 19:30
serializing json with non-string keys in a map
/*! `python` grammar compiled for Highlight.js 11.10.0 */
var hljsGrammar=(()=>{"use strict";return e=>{
const n=e.regex,a=/[\p{XID_Start}_]\p{XID_Continue}*/u,s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],t={
$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,
built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super"