Skip to content

Instantly share code, notes, and snippets.

View eileencodes's full-sized avatar

Eileen eileencodes

View GitHub Profile

Bisect Summary

All numbers below are from a local bundler-bench run (rails scenario, 164 gems, macOS ARM64, Ruby 4.0.1, local gem server, hyperfine median of 3 iterations). Raw JSON for all 72 runs is available upon request.

A note on terminology: the benchmark's cold run wipes everything (vendor, .bundle, all caches, lockfile). Its warm run wipes only vendor/bundle and .bundle — the download cache, global extracted cache, and lockfile are preserved. From a project's point of view a "warm" run is a fresh project install that hits a populated system cache, which is the most common day-to-day scenario (re-bundling after a Gemfile change, CI with cache restore, switching branches, etc.). Throughout this review, "warm" means that scenario.

  1. Of the nine optimization groups in this PR, five are neutral on macOS (within benchmark noise of master, ±5%). They neither help nor hurt.
  2. **Two groups (the Source::Rubygems + RubyGemsGemInstaller rework) account for 100% of the measured per
testing
editing the gist?

Homebrew Formula patching old ImageMagick release 6.7.7-6

Install

$ brew install https://gist.githubusercontent.com/eileencodes/281a8a9c7e0598fc9da9a7d4bf6d1a89/raw/8880be85b339c8206197e59b543c16f2ac1e4839/imagemagick.rb

Tested

@eileencodes
eileencodes / gist:30dca64c4656055d7d36
Created January 27, 2015 19:10
without_on_signal
Calculating -------------------------------------
INDEX: Integration Test
38.000 i/100ms
INDEX: Functional Test
100.000 i/100ms
-------------------------------------------------
INDEX: Integration Test
409.331 (± 6.8%) i/s - 2.052k
INDEX: Functional Test
1.016k (± 5.5%) i/s - 5.100k
@eileencodes
eileencodes / gist:5b0a2fe011dcff6203fe
Last active October 28, 2021 14:21
CollectionProxy `delete_all` and `destroy_all` behavior by dependency AND association type AND strategy

Testing behavior of a CollectionProxy based on :dependent option, delete method used and assocation type (:has_many vs :has_many :through)

:has_many association

class Category < ActiveRecord::Base
	has_many :contacts, through: :categorizations
	has_many :categorizations, dependent: DEPENDENT
end
### Keybase proof
I hereby claim:
* I am eileencodes on github.
* I am eileencodes (https://keybase.io/eileencodes) on keybase.
* I have a public key whose fingerprint is 12F2 6419 FD01 0115 7E0F 42F6 BA5C 5751 20BB E8DF
To claim this, I am signing this object:
@eileencodes
eileencodes / posts.rb
Created August 2, 2012 19:45
adding category selectors to active admin
index do
column :title, :sortable => :title do |post|
link_to post.title, [:edit_admin, post]
end
column :categories do |post|
table_for post.categories.order('title ASC') do
column do |category|
link_to category.title, [ :admin, category ]
end
@eileencodes
eileencodes / emails_controller.rb
Created August 1, 2012 17:27
honeypot response
if params[:sweet_honey].present?
format.html { render :partial => "emails/email_bot", :layout => false }
elsif @email.save
...
else
...
end
@eileencodes
eileencodes / _form.html.erb
Created August 1, 2012 17:23
field for honeypot
<div class="field sweet_honey_for_bots">
<%= label_tag :sweet_honey, "This is a honeypot, if you see this you're CSS is turned off or you're a bot. If you're not a bot don't fill it in." %>
<%= text_field_tag :sweet_honey %>
</div>
@eileencodes
eileencodes / admin_users.rb
Created June 12, 2012 23:31
Admin Users Views for Active Admin
ActiveAdmin.register AdminUser do
index do
column :id
column :email
column :full_name do |field|
"#{field.first_name} #{field.last_name}"
end
column :last_sign_in_at
default_actions