Skip to content

Instantly share code, notes, and snippets.

View MaxGhenis's full-sized avatar

Max Ghenis MaxGhenis

View GitHub Profile
╭───────────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code research preview! │
│ │
│ /help for help │
│ │
│ cwd: /Users/maxghenis/PolicyEngine/policyengine-us │
╰───────────────────────────────────────────────────────╯
What's new:
╭───────────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code research preview! │
│ │
│ /help for help │
│ │
│ cwd: /Users/maxghenis/PolicyEngine/policyengine-us │
╰───────────────────────────────────────────────────────╯
> use this package to calculate the snap benefit for a single person with 10k employment income in dc in 2025
╭───────────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code research preview! │
│ │
│ /help for help │
│ │
│ cwd: /Users/maxghenis/PolicyEngine/policyengine-us │
╰───────────────────────────────────────────────────────╯
> im putting together a proposal to expand policyengine us
capabilities. weve priced out most of the programs but not
with lessons learned.
⏺ Bash(gh issue create --title "Fix URL path decoding to handle multiple square …
brackets" --body "## Issue Description\nThe `findInTree` function in
`src/api/variables.js` has a bug where it only replaces the first occurrence
of URL-encoded square brackets (%5B, %5D) with their decoded equivalents ([,
]).\n\n## Problem\nWhen a path contains multiple square brackets (e.g.,
something like 'input.households[0].members[1]'), only the first set gets
properly decoded, potentially causing issues when navigating the variable
tree structure.\n\nCurrent code:\n```javascript\npath = path.replace(\"%5B\",
╭───────────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code research preview! │
│ │
│ /help for help │
│ │
│ cwd: /Users/maxghenis/PolicyEngine/policyengine-us │
╰───────────────────────────────────────────────────────╯
> we got this question, can you investigate? note our parameters and variables
for snap are in gov/usda/snap but we also might reference gov/hhs/tanf/non_cash

Guide to Impersonating Max Ghenis in Code Reviews

  1. Focus on consistency in methodology
    • Point out when approaches differ from established patterns
    • Ask clarifying questions about methodological choices: "Why not reweight for it again?"
  2. Prefer specific technical solutions
    • When identifying issues, suggest specific technical fixes with examples
    • Reference specific libraries or functions: "The PCHIP Interpolator seems ideally suited to this..."
    • Include code snippets or examples when suggesting solutions
  3. Emphasis on proper documentation and linking
  • Encourage proper linking between PRs and issues: "In the future please link PRs to issues to close them automatically"
def compute_tax(income, brackets):
"""
Compute tax given taxable income and a list of brackets.
Each bracket is a tuple: (lower_threshold, upper_threshold, rate).
"""
tax = 0.0
for lower, upper, rate in brackets:
if income > lower:
taxable = min(income, upper) - lower
tax += taxable * rate

Prompt:

is there a way to export a google doc to markdown, with comments? maybe using api?

Response:

Let me help you create a script that can export a Google Doc to Markdown while preserving comments. We'll need to use the Google Docs API.

Google Docs to Markdown Converter with Comments

Click to open code

Prompt:

undefined

Response:

undefined

Prompt:

trump is the gop nominee for president. biden is the dem nominee. i know you have limited information and no real time info, but given what you know, what chance would you give to trump winning? think through how youd give a probabilistic forecast

Response:

@MaxGhenis
MaxGhenis / gist:113b800695462a55ed577df77de3564d
Created March 18, 2023 04:06
ChatGPT4 React suggestion for policy impact written template
import React from 'react';
const PolicyAnalysis = ({ baseline, reform, impacts, outcomes, incomeChanges, povertyRates, deepPovertyRates, genderPoverty, inequality }) => {
const generateIncomeChangeText = () => {
let text = "";
incomeChanges.average.forEach((value, index) => {
text += `The ${index + 1}${index === 0 ? "st" : index === 1 ? "nd" : index === 2 ? "rd" : "th"} decile experiences an average change of $${value.toFixed(2)}. `;
});
return text;