915 karma · joined Jan 13, 2009 (17y ago) · 182 submissions
comment 9mo ago · link · parent
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 9mo ago · link · parent
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.5.
Ruby Prism Skill – CLI skill for understanding Ruby files(github.com ↗)
3 points · by AndrewHampton · 9mo ago · 1 comment
comment 9mo ago · link · parent
comment 1y ago · link · parent
Turns out, it's complicated.
comment 1y ago · link · parent
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 2y ago · link · parent
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 2y ago · link · parent
comment 2y ago · link · parent
> 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.
comment 2y ago · link · parent
> gfx='git commit --fixup $(git log $(git merge-base main HEAD)..HEAD --oneline| fzf| cut -d" " -f1)'
It shows you the commits on the current branch and lets you select one via fzf. It then creates the fixup commit based on the commit you selected.
comment 2y ago · link · parent
comment 2y ago · link · parent
For rails specifically, https://github.com/polleverywhere/moat was built with this in mind. It's heavily inspired by Pundit, but let's you write policies at the `ActiveRecord::Relation` level. So `policy_filter(Article).find_by!(id: params[:id])` would run something like `select * from articles where id = ? and id in (select id from articles where owner_id = ?);`.
19.
Content Security Policy (CSP): What Every Web Developer Must Know(akshaykhot.com ↗)
2 points · by AndrewHampton · 3y ago · discuss
comment 6y ago · link · parent
- most starred repositories that haven't been in the newsletter before
- most starred repositories that were created that day
- most starred repositories
comment 7y ago · link · parent
The main problem is very commit titles that end up looking like:
feat(SomeScope.OtherScope.Class): add support for abc and xyz optioncomment 7y ago · link · parent
However, I don't find it that useful in the the final applications, even counter productive, since it typically will take up quite a bit of space in the commit title. Many of our front end devs completely ignore title length conventions now.
comment 7y ago · link · parent