Skip to content

Instantly share code, notes, and snippets.

@legel
legel / ameriflux_downloader.sh
Created March 21, 2026 16:14
Quick proposed modification to Q.E.D. Lab FLUXNET Data Explorer
#!/usr/bin/env bash
# Below is a proposed modification for the automatically generated .sh script from https://www.keenangroup.info/fluxnet-explorer.html
# Specific change is related to making it easier for users across operating systems to install `jq`
set -euo pipefail
OUTDIR="${1:-ameriflux_downloads}"
SITES_FILE="${2:-ameriflux_selected_sites.txt}"
LOGFILE="${3:-ameriflux_bulk_download.log}"
@legel
legel / gist:bd762053b5d88d78bfb469e50a34a12a
Created July 19, 2025 03:47
Earth Engine download Satellite Embeddings v1
import ee
import json
import math
from typing import List, Tuple, Dict
import time
# Initialize Earth Engine
ee.Initialize(project='...')
class EmbeddingPatchExporter:
@legel
legel / export_cursor_chat_history_to_md.py
Last active March 16, 2026 01:41
Did Cursor crash? Did you lose your Cursor chat history? Need to export your data? This script was generated by Cursor to export your chat history in .md format from its potential location on a local SQL server. This can be fed back into a new Cursor chat as Context. Happy vibe coding.
#!/usr/bin/env python3
import sqlite3
import json
from pathlib import Path
from datetime import datetime
import os
import base64
def extract_conversations_from_db(db_path):
"""Extract all conversations from the database with detailed error handling."""