Skip to content

Instantly share code, notes, and snippets.

View eileencodes's full-sized avatar
👩‍💻

Eileen M. Uchitelle eileencodes

👩‍💻
View GitHub Profile
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
@eileencodes
eileencodes / airbrake.txt
Created March 19, 2012 18:08
What you will see if airbrake runs correctly
append config/deploy.rb
create config/initializers/airbrake.rb
run rake airbrake:test --trace from "."
** Invoke airbrake:test (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute airbrake:test
Configuration: