Skip to content

Instantly share code, notes, and snippets.

@leehanchung
leehanchung / claude_code_csp.mjs
Created March 8, 2025 23:14
claude code using aws vertexai
var c9 = !!process.env.CLAUDE_CODE_USE_BEDROCK,
p9 = !!process.env.CLAUDE_CODE_USE_VERTEX,
Tl1 = {
bedrock: 'us.anthropic.claude-3-7-sonnet-20250219-v1:0',
vertex: 'claude-3-7-sonnet@20250219',
firstParty: 'claude-3-7-sonnet-20250219',
},
PB = c9
? 'us.anthropic.claude-3-5-haiku-20241022-v1:0'
: p9
@leehanchung
leehanchung / test.py
Created March 8, 2025 23:40
testing aws bedrock seetup for claude code
import boto3
import json
client = boto3.client('bedrock-runtime', region_name='us-east-1')
response = client.invoke_model(
modelId='us.anthropic.claude-3-7-sonnet-2025-0219-v1:0',
body=json.dumps({
"anthropic_version": "bedrock-2023-05-31",
"messages": [
flowchart TD
    %% Main Entry Point and Initialization
    Start([Application Start]) --> ParseArgs[Parse Command Line Arguments]
    ParseArgs --> CheckStdin{Check stdin}
    CheckStdin -->|Input Piped| ProcessPiped[Process Piped Input]
    CheckStdin -->|Interactive Mode| CheckAuth{Authentication Status}
    
    %% Authentication Flow
    CheckAuth -->|Not Authenticated| OAuthFlow[OAuth Authentication]
@leehanchung
leehanchung / steve-yegge-google-platform-rant.md
Created November 25, 2025 02:34 — forked from kislayverma/steve-yegge-google-platform-rant.md
A copy (for posterity) of Steve Yegge's internal memo in Google about what platforms are and how Amazon learnt to build them

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't really have SREs and they make engineers pretty much do everything,