Urgent.News

What's breaking now, across thousands of outlets.

More in Tech

Record One Nested Decision, Then Extract a Single Predicate

A pricing function still folds region rules, bulk surcharges, and coupon stacking into one nested block. A teammate asks an assistant to tidy that module before a tax change lands next week.

  • Nested pricing function consolidates multiple rules into one block of code
  • Colleague suggests refactoring module ahead of tax change
  • Record one nested decision on hot path before extracting single predicate

Stop exporting design tokens to JSON for your web apps

A PR review last Thursday morning triggered this thought. A developer had written a 40-line utility function in our main web repository.

  • Excessive JSON use for design tokens causes unnecessary complexity.
  • CSS variables are optimized for reading, cascading, and updating design values.
  • Design System Sync Figma plugin exports tokens directly to CSS variables.

Read-only user impersonation in Rails

Many support tools eventually grow a "log in as this customer" feature. Ours had a problem the usual gems don't solve. The people on the other side of the button are customers of a service containing…

  • ViewingAs gem restricts administrators from sensitive actions during impersonation
  • Prevents non-GET/HEAD requests and logs write attempts at error level
  • Consent lambda determines impersonation based on customer preferences

More from Wednesday 23 September →