Skip to content

Commit

Permalink
chore: add middleware for rewrite requests
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
  • Loading branch information
aarnphm committed Jan 25, 2025
1 parent e4faea9 commit cab2789
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 26 deletions.
4 changes: 2 additions & 2 deletions content/References.bib
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ @article{elhage2021mathematical
author={Elhage, Nelson and Nanda, Neel and Olsson, Catherine and Henighan, Tom and Joseph, Nicholas and Mann, Ben and Askell, Amanda and Bai, Yuntao and Chen, Anna and Conerly, Tom and DasSarma, Nova and Drain, Dawn and Ganguli, Deep and Hatfield-Dodds, Zac and Hernandez, Danny and Jones, Andy and Kernion, Jackson and Lovitt, Liane and Ndousse, Kamal and Amodei, Dario and Brown, Tom and Clark, Jack and Kaplan, Jared and McCandlish, Sam and Olah, Chris},
year={2021},
journal={Transformer Circuits Thread},
note={https://transformer-circuits.pub/2021/framework/index.html}
url={https://transformer-circuits.pub/2021/framework/index.html}
}

@article{olsson2022context,
title={In-context Learning and Induction Heads},
author={Olsson, Catherine and Elhage, Nelson and Nanda, Neel and Joseph, Nicholas and DasSarma, Nova and Henighan, Tom and Mann, Ben and Askell, Amanda and Bai, Yuntao and Chen, Anna and Conerly, Tom and Drain, Dawn and Ganguli, Deep and Hatfield-Dodds, Zac and Hernandez, Danny and Johnston, Scott and Jones, Andy and Kernion, Jackson and Lovitt, Liane and Ndousse, Kamal and Amodei, Dario and Brown, Tom and Clark, Jack and Kaplan, Jared and McCandlish, Sam and Olah, Chris},
year={2022},
journal={Transformer Circuits Thread},
note={https://transformer-circuits.pub/2022/in-context-learning-and-induction-heads/index.html}
url={https://transformer-circuits.pub/2022/in-context-learning-and-induction-heads/index.html}
}

@article{elhage2022superposition,
Expand Down
37 changes: 19 additions & 18 deletions content/thoughts/Expenses.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tags:
- evergreen
date: "2024-01-09"
description: and my livelihood.
modified: 2025-01-05 23:51:20 GMT-05:00
modified: 2025-01-25 01:08:29 GMT-05:00
noindex: true
title: Expenses
---
Expand All @@ -15,22 +15,23 @@ title: Expenses
### Subscriptions:

| Description | $ | occurrence | Currency | Card |
| ----------------------------- | --------- | ---------- | -------- | ----- |
| Apple TV | 9.95 | M | USD | Chase |
| Discord Nitro | 9.99 | M | USD | Chase |
| Uber One | 9.99 | M | USD | Chase |
| Youtube Premium Student | 7.99 | M | USD | Chase |
| Max | 14.99 | M | USD | Chase |
| bookbear express | 70 | Y | USD | Chase |
| Claude | 240 | Y | USD | Chase |
| ChatGPT | 240 | Y | USD | Chase |
| Vocabulary | 29.99 | Y | USD | Chase |
| Duolingo Max | 149.99 | Y | USD | Chase |
| Strava | 79.99 | Y | USD | Chase |
| Twitter Premium+ | 210 | Y | USD | Chase |
| Grammarly (for mom) | 144 | Y | USD | Chase |
| [[thoughts/fashion\|fashion]] | recurrent | year | USD | Chase |
| Description | $ | occurrence | Currency | Card | Notes |
| ----------------------------- | --------- | ---------- | -------- | ----- | --------- |
| Apple TV | 9.95 | M | USD | Chase | |
| Discord Nitro | 9.99 | M | USD | Chase | |
| Uber One | 9.99 | M | USD | Chase | |
| Youtube Premium Student | 7.99 | M | USD | Chase | |
| Max | 14.99 | M | USD | Chase | |
| bookbear express | 70 | Y | USD | Chase | |
| Claude | 240 | Y | USD | Chase | |
| Midjourney | 10 | M | USD | Chase | |
| Vocabulary | 29.99 | Y | USD | Chase | |
| Duolingo Max | 149.99 | Y | USD | Chase | |
| Strava | 79.99 | Y | USD | Chase | |
| Twitter Premium+ | 210 | Y | USD | Chase | |
| Cursor Pro | 192 | Y | USD | Chase | |
| Grammarly | 144 | Y | USD | Chase | (for mom) |
| [[thoughts/fashion\|fashion]] | recurrent | year | USD | Chase | |

### Archive:

Expand All @@ -39,6 +40,6 @@ List of subscription I have stopped using.
| Description | $ | occurrence | Currency | Card |
| -------------- | ----- | ---------- | -------- | ----- |
| Apple One | 19.95 | M | USD | Chase |
| Midjourney | 10 | M | USD | Chase |
| Supermaven Pro | 10 | M | USD | Chase |
| ChatGPT Plus | 240 | Y | USD | Chase |
| Perplexity Pro | 200 | Y | USD | Chase |
3 changes: 1 addition & 2 deletions content/thoughts/induction heads.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tags:
- ml
date: "2025-01-18"
description: and mathematical framework of transformers
modified: 2025-01-18 19:41:25 GMT-05:00
modified: 2025-01-24 23:47:52 GMT-05:00
title: induction heads
---

Expand All @@ -28,4 +28,3 @@ One salient property of linear residual stream is that we can think of each expl
## priviledged basis

tldr: we can rotate it all matrices interacting with the layers without modifying the models' behaviour.

4 changes: 2 additions & 2 deletions content/thoughts/representations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tags:
- seed
- philosophy
date: "2024-02-25"
modified: 2024-12-08 04:30:25 GMT-05:00
modified: 2025-01-25 01:07:46 GMT-05:00
title: representations.
---

Expand All @@ -18,7 +18,7 @@ Maps shape _==how we see and understand the world==_, which in turn shapes how w

## maps

[Linus' talk on Representation](https://www.media.mit.edu/events/thinking-with-sand-a-virtual-talk-series-exploring-new-software-interfaces-and-tools-for-augmented-thinking-and-creative-exploration/)
[Linus' talk on Representation](https://www.youtube.com/watch?v=Tt_hDVN5TZE&list=PL_Kh09CR3iHa1ZPi4EsHeqX-1IB3CRLbA&index=2&ab_channel=CharStiles)

how it shape our _agency_

Expand Down
4 changes: 3 additions & 1 deletion content/tweets.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tags:
- seed
date: "2024-10-24"
description: collections of tweets I like, since bookmark is getting crowded.
modified: 2025-01-24 02:30:39 GMT-05:00
modified: 2025-01-24 21:39:42 GMT-05:00
noindex: true
title: /xeets/
---
Expand Down Expand Up @@ -153,3 +153,5 @@ https://x.com/behrouz_ali/status/1878859086227255347 <!-- Titan, scaling Neural
https://x.com/vllm_project/status/1879979185474859303 <!-- By yours truly -->

https://x.com/flowersslop/status/1882241958397067677 <!-- R1 having existential crisis -->

https://x.com/rupspace/status/1877882538859078084 <!-- Highway network -->
10 changes: 9 additions & 1 deletion functions/_middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ export async function onRequest(context) {

const url = new URL(request.url)

if (url.pathname.endsWith(".pdf")) {
// Only apply logic for notes.aarnphm.xyz and root path
if (url.hostname === "notes.aarnphm.xyz" && url.pathname === "/") {
const slug = "notes"
const newUrl = new URL(`/${slug}`, request.url)
newUrl.searchParams.set("stackedNotes", btoa(slug).replace(/=+$/, ""))
// Rewrite the request with the new URL
const newRequest = new Request(newUrl, request)
return context.next(newRequest)
} else if (url.pathname.endsWith(".pdf")) {
const githubUrl = `https://media.githubusercontent.com/media/aarnphm/aarnphm.github.io/refs/heads/main/content${url.pathname}`
return await fetch(new Request(githubUrl, { method: "GET", headers: request.headers })).then(
async (resp) => {
Expand Down

0 comments on commit cab2789

Please sign in to comment.