Skip to content

Instantly share code, notes, and snippets.

View mguterl's full-sized avatar

Mike Guterl mguterl

View GitHub Profile
@mguterl
mguterl / newrelic_outline.mkd
Created September 12, 2012 19:36 — forked from queso/newrelic_outline.mkd
New Relic Outline

Don't be blind when making adjustments for performance. Measure, measure, measure.

Overview

New Relic is a great product for monitoring the peformance of your application. They provide performance management for Ruby, PHP, .Net, Java and Python. Today's presentation is going to focus on Ruby and specifically Rails, however, the basic New Relic overview will be applicable to any of the platforms mentioned. Integrating New Relic into your Rails application is as easy as signing up and adding the gem to your Rails application's Gemfile.

Apdex

When measuring performance in the browser or on the server New Relic provides Apdex scores. Apdex is

# Syntax highlighting for pre/code blocks
require 'rack/pygmoku'
use Rack::Pygmoku, :lexer_attr => 'lang'
# Workaround https://github.com/heroku/heroku-buildpack-python/issues/5
RubyPython.configure :python_exe => 'python2.6'
require "net/http"
module Sunspot
class BlockingServer < ::Sunspot::Rails::Server
def start
@started = Time.now
super
up
rescue ::Sunspot::Server::AlreadyRunningError
# do nothing
@mguterl
mguterl / .rvmrc
Created February 21, 2012 23:19 — forked from st23am/urinal_etiquette.rb
Test Problem
#!/usr/bin/env bash
# This is an RVM Project .rvmrc file, used to automatically load the ruby
# development environment upon cd'ing into the directory
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
# Only full ruby name is supported here, for short names use:
# echo "rvm use 1.9.3" > .rvmrc
environment_id="ruby-1.9.3-p0@cincirb_katas"
Installing rubygems-1.8.15 for system ...
Error running 'GEM_PATH=":@global" GEM_HOME="" "/Users/michaelguterl/.rvm/rubies/system/bin/ruby" "/Users/michaelguterl/.rvm/src/rubygems-1.8.15/setup.rb"', please read /Users/michaelguterl/.rvm/log/system/rubygems.install.log
[2012-01-29 09:07:38] GEM_PATH=":@global" GEM_HOME="" "/Users/michaelguterl/.rvm/rubies/system/bin/ruby" "/Users/michaelguterl/.rvm/src/rubygems-1.8.15/setup.rb"
/Users/michaelguterl/.rvm/scripts/functions/utility: line 163: /Users/michaelguterl/.rvm/rubies/system/bin/ruby: No such file or directory
@mguterl
mguterl / gist:1423669
Created December 2, 2011 15:39
Silence ActionMailer warnings when using deliver_* class methods
# The ActionMailer interface in Rails >= 3 sucks. Besides when
# testing the mailer, I see no reason to instantiate an object and
# then deliver it. Extend your mailer with this module to silence the
# warnings and enjoy life once again.
module SilenceDeliverWarnings
def method_missing(method, *args)
if method.to_s =~ /^deliver_(.*)/
send($1, *args).deliver
else
@mguterl
mguterl / BusinessStore.rb
Created November 24, 2011 22:32 — forked from Justinwceo/BusinessStore.rb
Sunspot: How to filter?
class BusinessStore < ActiveRecord::Base
attr_accessible :website, :name, :address, :phone_number, :online_store
has_many :products
end
module Sunspot
class ResqueSessionProxy < Sunspot::SessionProxy::AbstractSessionProxy
attr_reader :original_session
delegate :config, :delete_dirty?, :dirty?,
:new_search, :search,
:new_more_like_this, :more_like_this,
:remove, :remove!,
pangaea ~/code/rm/events[master]$ bundle update oa-recruitmilitary
Updating git@github.com:recruitmilitary/oa-recruitmilitary.git
Fetching source index for http://rubygems.org/
Bundler could not find compatible versions for gem "nokogiri":
In Gemfile:
oa-recruitmilitary depends on
nokogiri (~> 1.4.2)
cucumber-rails depends on
nokogiri (1.5.0)