Skip to content

Instantly share code, notes, and snippets.

View dissolved's full-sized avatar

Ryan Sandridge dissolved

View GitHub Profile
@seanmarcia
seanmarcia / tools_tips.md
Created September 30, 2017 19:41
Collection of Powertools, Tips and Tricks discussed at Retrocession.

Powertools, Tips, and Tricks Notes:

User experience monitoring tools:

  • Fullstory - JS you drop on your page that records user session.
    • Integrates with other services (like bugsnag) so, for example, when you see an error appear in bugsnag you can go and watch to see how the user created that error.
    • Is an external service that you need to log in to to view user sessions/videos/etc.
  • Ahoy - User metrics on which parts of your app they are interacting with.
    • You have full control of the data it records -- you can send it to your database, kinesis, etc.
  • Heroku sends data through a proxy (if you are worried about adblockers preventing you from getting user metrics) and then feeds the info into segment.io
@cupakromer
cupakromer / bool_only_predicates.rb
Created May 22, 2014 23:15
Hack to force bool only predicates
# Original: http://media.pragprog.com/titles/ruby4/code/metaprogramming/trace_calls.rb
#
# Modified to enforce opinionated predicate responses.
# Go buy and read the book!
# Note: This is **not** thread safe.
module BoolOnlyPredicates
def self.included(klass)
klass.instance_methods(false).each do |existing_method|
wrap(klass, existing_method)
end
@apprentice1988
apprentice1988 / Copy a Remote File to S3 with Ruby
Created April 20, 2014 01:54
Copy a Remote File to S3 with Ruby
require 'net/http'
AWS::S3::Base.establish_connection!({
access_key_id: 'your-access-key-id',
secret_access_key: 'your-secret-access-key'
})
# Use the Google Logo as an example
#
url = URI("https://www.google.com/images/srpr/logo3w.png")
@t2
t2 / application.rb
Created December 12, 2011 02:13
Formatting Rails form elements for Twitter Bootstrap error validation
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
html = %(<div class="field_with_errors">#{html_tag}</div>).html_safe
# add nokogiri gem to Gemfile
elements = Nokogiri::HTML::DocumentFragment.parse(html_tag).css "label, input"
elements.each do |e|
if e.node_name.eql? 'label'
html = %(<div class="clearfix error">#{e}</div>).html_safe
elsif e.node_name.eql? 'input'
if instance.error_message.kind_of?(Array)
html = %(<div class="clearfix error">#{html_tag}<span class="help-inline">&nbsp;#{instance.error_message.join(',')}</span></div>).html_safe
@dhh
dhh / gist:1014971
Created June 8, 2011 18:09
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end