Skip to content

Instantly share code, notes, and snippets.

View hervenivon's full-sized avatar
🎨
Teaching art to computers

Hervé Nivon hervenivon

🎨
Teaching art to computers
View GitHub Profile
@pauldambra
pauldambra / posthog-cloudfront.ts
Created July 20, 2022 10:08
A gist to create a cloudfront proxy for PostHog
import * as cdk from "aws-cdk-lib";
import * as cloudfront from "aws-cdk-lib/aws-cloudfront";
import * as cloudfront_origins from "aws-cdk-lib/aws-cloudfront-origins";
import { Construct } from "constructs";
// created by PostHog user CJ Enright
// shared in our community slack https://posthogusers.slack.com/archives/CTLTM70RM/p1657732914776719
// many thanks to them 🙌💖
export class PostHogProxy extends cdk.Stack {
constructor(scope: Construct, id: string) {
@mrtj
mrtj / stream_to_s3.py
Last active February 8, 2025 22:36
Download a file and stream it directly to an #aws S3 bucket without saving it locally
#!/usr/bin/env python3
import boto3
import requests
import tqdm
from urllib.parse import urlparse
def stream_to_s3(
source_url,
target_url,
Understand the Task: Grasp the main objective, goals, requirements, constraints, and expected output.
- Minimal Changes: If an existing prompt is provided, improve it only if it's simple. For complex prompts, enhance clarity and add missing elements without altering the original structure.
- Reasoning Before Conclusions: Encourage reasoning steps before any conclusions are reached. ATTENTION! If the user provides examples where the reasoning happens afterward, REVERSE the order! NEVER START EXAMPLES WITH CONCLUSIONS!
- Reasoning Order: Call out reasoning portions of the prompt and conclusion parts (specific fields by name). For each, determine the ORDER in which this is done, and whether it needs to be reversed.
- Conclusion, classifications, or results should ALWAYS appear last.
- Examples: Include high-quality examples if helpful, using placeholders [in brackets] for complex elements.
- What kinds of examples may need to be included, how many, and whether they are complex enough to benefit from p