Back to APIs list

Github API examples & templates

Use these vals as a playground to view and fork Github API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
oldBringing_My_OCD_Online
willthereader
oldBringing_My_OCD_Online
Remix of: willthereader/oldHomepage
blackRodent
stevekrouse
blackRodent
Remix of: willthereader/oldProjects
purpleHornet
stevekrouse
purpleHornet
Remix of: willthereader/oldBringing_My_OCD_Online
azureBeetle
stevekrouse
azureBeetle
Remix of: willthereader/oldHomepage
semanticSearchTurso
janpaul123
semanticSearchTurso
Part of Val Town Semantic Search . Uses Turso to search embeddings of all vals, using the sqlite-vss extension. Call OpenAI to generate an embedding for the search query. Query the vss_vals_embeddings table in Turso using vss_search . The vss_vals_embeddings table has been generated by janpaul123/indexValsTurso . It is not run automatically. This table is incomplete due to a bug in Turso .
tinygoHttpExample
maxm
tinygoHttpExample
A Go http handler running in Val Town: The Go source is here . Mandelbrot rendering code taken from here . I used maxm/compileAndUploadTinygoWasm to compile the code and create the val. $ git clone git@github.com:maxmcd/go-town.git $ cd go-town/val-town-tinygo-http-example $ deno run --allow-net --allow-run --allow-read "https://esm.town/v/maxm/compileAndUploadTinygoWasm?v=58" Running tinygo build -o main.wasm -target=wasi . Compliation complete Running wasm-strip main.wasm Copy the following into a val town HTTP val: import { wasmHandler } from "https://esm.town/v/maxm/tinygoHttp"; const resp = await fetch("https://maxm-wasmblobhost.web.val.run/jpxqvyy5tphiwehzklmioklpkpz4gpzs.wasm"); const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer())); export default async function(req: Request): Promise<Response> { return handler(req); }
indexValsTurso
janpaul123
indexValsTurso
Remix of: sqlite/leaderboard
bloomingButton
maxm
bloomingButton
Add a blooming emoji effect when a button is clicked. Import this val as a module and add the bloom-button class to your button. Demo here: https://www.val.town/v/maxm/bloomingButtonDemo /** @jsxImportSource https://esm.sh/react */ import { renderToString } from "npm:react-dom/server"; export default async function(req: Request): Promise<Response> { return new Response( renderToString( <> <link rel="stylesheet" href="https://jenil.github.io/bulmaswatch/simplex/bulmaswatch.min.css" /> <div style={{ textAlign: "center", marginTop: "100px" }}> <button className="is-success button bloom-button" id="treeButton">Click Me</button> </div> <script type="module" src="https://esm.town/v/maxm/bloomingButton" /> </>, ), { headers: { "content-type": "text/html" } }, ); }
tinygoMandelbrotExample
stevekrouse
tinygoMandelbrotExample
Remix of: maxm/tinygoHttpExample
AtelierHarfangToRSS
vogelino
AtelierHarfangToRSS
Remix of: vogelino/TanStackBlogToRSS
TanStackBlogToRSS
vogelino
TanStackBlogToRSS
Remix of: curtcox/markdown_download
compileAndUploadTinygoWasm
maxm
compileAndUploadTinygoWasm
Compile and Upload Tinygo WASM to Val Town Using Deno Make a Go program like so: package main import ( "fmt" "net/http" gotown "github.com/maxmcd/go-town" ) func main() { gotown.ListenAndServe(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") })) } Make sure you have tinygo (and optionally wasm-strip) installed. Then run this command with Deno to invoke this script: deno run --allow-net --allow-run --allow-read \ "https://esm.town/v/maxm/compileAndUploadTinygoWasm?v=58" That will print out the following: Running tinygo build -o main.wasm -target=wasi . Compliation complete Running wasm-strip main.wasm Copy the following into a val town HTTP val: import { wasmHandler } from "https://esm.town/v/maxm/tinygoHttp"; const resp = await fetch("https://maxm-wasmBlobHost.web.val.run/jpxqvyy5tphiwehzklmioklpkpz4gpzs.wasm"); const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer())); export default async function(req: Request): Promise<Response> { return handler(req); } Copy that into a Val and you have a working Go http handler! View that example here: https://www.val.town/v/maxm/crimsonMacaw
tinygoWasmHelloWorld
maxm
tinygoWasmHelloWorld
Tinygo Wasm Example Go Source: package main import ( "fmt" "net/http" gotown "github.com/maxmcd/go-town" ) func main() { gotown.ListenAndServe(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World") })) } Built with: deno run --allow-net --allow-run --allow-read \ "https://esm.town/v/maxm/compileAndUploadTinygoWasm?v=58"
mediumToMarkdown
fossforlife
mediumToMarkdown
// Altered from https://github.com/ericclemmons/medium-to-markdown
linkInBioTemplate
vhugoobject
linkInBioTemplate
Remix of: stevekrouse/linkInBioTemplate
honoExample
willthereader
honoExample
Remix of: maxm/honoExample