Skip to content

Instantly share code, notes, and snippets.

View eastlondoner's full-sized avatar

Andrew Jefferson eastlondoner

View GitHub Profile
@eastlondoner
eastlondoner / requests.log
Created March 27, 2025 20:51
Claude writes a hello world python script
{
"max_tokens": 20000,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "write a python script that prints 'Hello, World!' to hello.py and make it executable then say 'all done'",
"cache_control": {
@eastlondoner
eastlondoner / general prompt
Last active March 18, 2025 00:07
Claude Code prompt for using git and GitHub extracted on 17th march 2025
`You are ${k2}, Anthropic's official CLI for Claude.`}async function yv(){return[`You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.
IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).
IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their mes
@eastlondoner
eastlondoner / claude_desktop_config.json
Created March 14, 2025 20:19
yo-mcp.com Claude Desktop Config
{
"mcpServers": {
"mcp-proxy": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/eastlondoner/mcp-proxy@main",
"mcp-proxy",
"<your endpoint address goes here>"
]
echo 'alias yolo="claude --dangerously-skip-permissions"' >> ~/.zshrc
source ~/.zshrc
@eastlondoner
eastlondoner / repro.sh
Created February 12, 2025 16:37
reproduce gemini issue
#!/usr/bin/env bash
#
# Usage:
# gemini-docs.sh <path-to-repoContext-file>
#
# Description:
# Reads text from the specified file (e.g. ".repomix-output.txt") as your repository
# context, then calls the Gemini API to generate documentation.
#
# Requirements:
To create a valid eBay UK listing using the Trading API, the `<ShippingDetails>` XML element is essential. It specifies shipping-related information for the item, including domestic and international shipping options, costs, and policies. Below is an example of a valid `<ShippingDetails>` XML structure for a listing on eBay UK:
```xml
<ShippingDetails>
<ShippingType>Flat</ShippingType>
<ShippingServiceOptions>
<ShippingServicePriority>1</ShippingServicePriority>
<ShippingService>UK_RoyalMailFirstClassStandard</ShippingService>
<ShippingServiceCost currencyID="GBP">3.99</ShippingServiceCost>
<FreeShipping>false</FreeShipping>
@eastlondoner
eastlondoner / Chat.txt
Created January 20, 2025 15:43
Distillation
Yes, very much so. Model distillation—often referred to as knowledge distillation—is a technique where a large, complex model (often called the “teacher”) is used to guide the training of a smaller, more efficient model (the “student”). The goal is to achieve comparable performance to the teacher model but with far fewer parameters or lower computational cost.
Here’s a quick summary of how knowledge distillation typically works:
1. Teacher Model: A large neural network (e.g., a deep Transformer model or a wide CNN) is trained on a given task until it achieves strong accuracy or other performance metrics.
2. Soft Targets or Logits: Rather than just using the final hard labels (like one-hot vectors in classification tasks), we use the teacher’s soft outputs. These are essentially the raw logits or the probabilities the teacher assigns to each class before making a hard decision. These “soft targets” carry more nuanced information about how the teacher model generalizes and how it “thinks” about different cla
@eastlondoner
eastlondoner / ask_gemini.sh
Last active January 10, 2025 07:59
Ask Gemini
#!/usr/bin/env bash
# make bash play nice
set -euo pipefail
# Load environment variables
source .env
# Check required environment variables
check_env_var() {
if [ -z "${!1:-}" ]; then
@eastlondoner
eastlondoner / swift_concurrency.md
Created January 3, 2025 14:03
Swift Concurrency Notes

In Swift’s concurrency model, you can handle multiple concurrent streams of work using async let or the TaskGroup API. Both approaches allow you to perform concurrent tasks and wait for their results.

Option 1: Using async let

async let is a concise way to launch multiple tasks concurrently and wait for their results.

func fetchData() async throws -> (String, Int, Bool) { async let stringResult = doSomethingAsync() async let intResult = somethingElseAsync() async let boolResult = thirdThingAsync()

@eastlondoner
eastlondoner / ConcurrentQueue.ts
Created March 27, 2023 11:26
Process Tasks using a Concurrent Queue in javascript
import { Readable } from 'node:stream';
export type ConcurrentQueueTask<T> = {
maxRetries: number;
getPromise: () => Promise<T>;
};
export type CreateConcurrentQueueParams = {
/*
* Max concurrency sets the maximum number of tasks that can be running at the same time.