Skip to content

Instantly share code, notes, and snippets.

View toadfans's full-sized avatar
🎯
Focusing

Yuhang Shi toadfans

🎯
Focusing
View GitHub Profile
@toadfans
toadfans / README.md
Created April 4, 2026 16:45 — forked from emschwartz/README.md
The Most Popular Blogs of Hacker News in 2025

This is an OPML version of the HN Popularity Contest results for 2025, for importing into RSS feed readers.

Plug: if you want to find content related to your interests from thousands of obscure blogs and noisy sources like HN Newest, check out Scour. It's a free, personalized content feed I work on where you define your interests in your own words and it ranks content based on how closely related it is to those topics.

@toadfans
toadfans / jupyter-swap.js
Created May 24, 2024 12:54 — forked from merlox/jupyter-swap.js
Here's how to make a swap programmatically in Jupyter for Solana. It works for me.
// Slippage is defined in bps which means 100 is 1% so we gotta multiply by 100
const getAmountOutJupyter = async (tokenA, tokenB, amount, slippage) => {
const url = `https://quote-api.jup.ag/v6/quote?inputMint=${tokenA}&outputMint=${tokenB}&amount=${Number(amount).toFixed(0)}&slippageBps=${slippage*100}`
let quote = null
try {
quote = await (await fetch(url)).json()
if (!quote) {
console.error('unable to quote')
return null
}
@toadfans
toadfans / README.md
Created September 22, 2023 06:09 — forked from acutmore/README.md
Emulating a 4-Bit Virtual Machine in (TypeScript\JavaScript) (just Types no Script)

A compile-time 4-Bit Virtual Machine implemented in TypeScript's type system. Capable of running a sample 'FizzBuzz' program.

Syntax emits zero JavaScript.

type RESULT = VM<
  [
    ["push", N_1],         // 1
    ["push", False],       // 2
 ["peek", _], // 3