AndrewHampton

Joined 18 years ago

Karma
915
Submissions
182
Member since
Jan 13
[ my public key: https://keybase.io/andrewhampton; my proof: https://keybase.io/andrewhampton/sigs/8ov2hJUPVQGL1VkZ-q-IkdcaOUSMeyA6E-G939rCCzk ]
View on Hacker News

Recent submissions

Comment · 2 months ago
I love jj and am a fan of the ideas of AT protocol, so tangled has been on my radar for a while. Last I checked though, it sounded like it was much better suited for open source code, not private repositories. Is that still the case?
Comment · 7 months ago
This seems like an important caveat to the SWE-bench, but the trend is still clearly AI becoming more and more capable.
Comment · 8 months ago
I love web components. The one thing I really wish browsers supported though was a per-site custom element registry that persisted across page loads.

Give me 10mb and an API like service workers have to manage a library of custom elements that can be used on my site as soon as the page loads.

Comment · 8 months ago
We've been experimenting with various skills and MCPs in our day-to-day Ruby development at Poll Everywhere. This is the internal skill that's been most useful for preserving the context window while letting agents explore Ruby code.

It's a CLI wrapper around Ruby's Prism gem that lets the agent do this:

  $ prism -o app/models/user.rb

  User < ApplicationRecord [1-75]
    includes Agreeable
    includes Auditable
    has_many :polls
    has_many :questions, through: :polls
    has_many :votes
    has_many :reports, dependent: :destroy
    #audit_create [41-43]
    #allowed_to_participate_in?(poll) [45-66]
    #restricted_from_participation_in?(poll) [68-70]
    #recently_created? [72-74]

  $ prism -m 'recently_created?' app/models/user.rb

  === METHOD: recently_created? ===
  Lines 72-74:
    def recently_created?
      created_at.after?(5.minutes.ago)
    end
The idea is to give the agent a token-efficient way to understand what's going on in Ruby code.
Comment · 9 months ago
Back in 2004, while bored in my college dorm, I learned the Ian Knot from this site. I've used it ever since. A few weeks ago, my 10 year old decided it was time to learn how to tie his shoes "dad's way". I was pleasantly surprised to see the site was still up, so I used it to help teach him how to do it.
Comment · 1 year ago
Is `jj split` a good option?
Comment · 1 year ago
Comment · 1 year ago
Part of me wonders if I should be on ozempic since I have a family history of several of the issues it's reported to help with.

Another part of me wonders if all the ozempic headlines I've seen over the past few months are just an incredibly effective and well orchestrated ad campaign.

Comment · 1 year ago
I used this to build my current keyboard a few months ago. It was my first hand-wired keyboard, and this made it much more approachable. Thanks for creating it!
Comment · 1 year ago
What HTTP method would you expect the second example to use? `GET /users/delete?id=354`?

The first has the advantage of being a little clearer at the HTTP level with `DELETE /users/354`.

Comment · 2 years ago
Yeah, I use about a dozen git aliases in my normal workflow. In case it's helpful, here are the relevant ones for this flow:

  alias git_main_branch='git rev-parse --abbrev-ref origin/HEAD | cut -d/ -f2'
  alias gapa='git add --patch'
  alias grbm='git rebase -i --autosquash $(git_main_branch)'
  alias gfx='git commit --fixup $(git log $(git_main_branch)..HEAD --oneline| fzf| cut -d" " -f1)'
Another favorite is:

  alias gmru="git for-each-ref --sort=-committerdate --count=50 refs/heads/ --format='%(HEAD) %(refname:short) | %(committerdate:relative) | %(contents:subject)'| fzf | sed -e 's/^[^[[:alnum:]]]*[[:space:]]*//' | cut -d' ' -f1| xargs -I _ git checkout _"
gmru (git most recently used) will show you the branches you've been working on recently and let you use fzf to select one to check out.
Comment · 2 years ago
This was 100% my inspiration. I used emacs+magit for years. After switching away from emacs for dev work, I still cracked it open for git interactions for another year or so. Eventually, I moved entirely to the shell with a bunch of aliases to replicate my magit workflow.
Comment · 2 years ago
Yeah, it's definitely less powerful that what absorb is doing. I wasn't trying to argue that it was equivalent. I just wanted to share a bash one-liner that I've had success with in case others find it helpful.

> What if I want some parts of it into one commit and another parts into another?

Looks like absorb will automatically break out every hunk into a separate fixup commit. My one-liner will create 1 fixup commit for everything that's staged. That's typically what I need, but on the occasions it's not, I use `git add -p`, as kadoban mentioned, to stage exactly what I want for each commit.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton