bash
6 lines · 1 tab
Kai Nakamura
Apr 2026
1 tab
#!/usr/bin/env bash
set -euo pipefail
bundle exec bundler-audit check --update
npm audit --audit-level=high
pip-audit --strict
1 file · bash
Explain with highlit
Known vulnerable dependencies are one of the easiest attack paths to close. I scan lockfiles in CI, fail builds on high-severity issues that have fixes, and document exceptions tightly. The goal is not zero alerts at any cost; the goal is fast visibility and clear remediation paths.
Related snips
ruby
class Money
include Comparable
attr_reader :amount, :currency
def initialize(amount, currency = 'USD')
Value objects for domain modeling
ruby
value-objects
domain-driven-design
by Sarah Mitchell
2 tabs
typescript
export type Settled<R> =
| { status: 'fulfilled'; value: R }
| { status: 'rejected'; reason: unknown };
export interface ConcurrencyOptions {
limit: number;
Simple concurrency limiter for batch operations
node
concurrency
async
by codesnips
2 tabs
ruby
# app/mailers/user_mailer.rb
class UserMailer < ApplicationMailer
default from: 'noreply@example.com'
def welcome_email(user)
@user = user
ActionMailer advanced patterns for transactional emails
ruby
rails
action-mailer
by Sarah Mitchell
2 tabs
ruby
# BAD: N+1 query problem
@users = User.all
@users.each do |user|
puts user.posts.count # Fires query for each user!
end
ActiveRecord query optimization and N+1 prevention
ruby
rails
activerecord
by Sarah Mitchell
3 tabs
typescript
import { randomBytes, createHash } from "crypto";
import jwt from "jsonwebtoken";
import { RefreshTokenStore } from "./store";
const ACCESS_SECRET = process.env.ACCESS_SECRET!;
const ACCESS_TTL = "15m";
JWT access + refresh token rotation (conceptual)
security
node
jwt
by codesnips
3 tabs
ruby
# Installation
# rails active_storage:install
# rails db:migrate
# config/storage.yml
local:
ActiveStorage for file uploads and attachments
ruby
rails
active-storage
by Sarah Mitchell
2 tabs
Share this code
Here's the card — post it anywhere.