Skip to content

Instantly share code, notes, and snippets.

View briandoll's full-sized avatar
😎
Helping companies market and sell more software

Brian Doll briandoll

😎
Helping companies market and sell more software
View GitHub Profile
<html>
<head>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="jquery.twitter.min.js"></script>
<style type="text/css">
body {background: #333; font-size: 64px; color: #999}
.twitter-posts {padding: 10px; list-style-type:none; border-bottom: 1px solid #000;}
.twitter-posts a {text-decoration:none; color: #FFF;}
</style>
<script type="text/javascript">
@briandoll
briandoll / correlations.rb
Created March 15, 2012 05:38
Correlation between terms in an array of arrays
class Correlations
# the dataset in question
attr_writer :dataset
# Count the number of instances an individual term appears
#
# Example:
# {"Ruby" => 3, "PHP" => 2, "C++" => 2}
attr_accessor :total_appearance_count
<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
@briandoll
briandoll / deployed.ruby.gems.10.2011.txt
Created October 20, 2011 22:59
Gem List Deployed in ruby applications monitored by New Relic, October 2011
Gem List Deployed in ruby applications monitored by New Relic, October 2011
Note: Efforts have been made to remove any "private" gems from this list. All gems in this list are publicly available on rubygems.org or were available on the Github gem host and are considered public. Please send an email to brian@newrelic.com if you feel that a gem on this list should not be made public. Additionally, only gems used in 10 or more applications are on this list.
Count Gem Name
===================
8108 rack
7990 rake
7973 activesupport
@briandoll
briandoll / full.plugin.list.txt
Created September 29, 2011 05:09
Full Plugin List Deployed in applications monitored by New Relic, September 2011
Full Plugin List Deployed in Rails applications monitored by New Relic, September 2011
Count Plugin Name
-------------------
2040 rpm
1534 newrelic_rpm
1268 acts_as_list
1186 paperclip
1130 will_paginate
1068 exception_notification
@briandoll
briandoll / top_plugins.state_of_the_stack.txt
Created September 28, 2011 19:00
Top 50 Rails Plugins in Production : New Relic State of the Stack : Q3 2011
Count Plugin
2040 rpm
1534 newrelic_rpm
1268 acts_as_list
1186 paperclip
1130 will_paginate
1068 exception_notification
1026 jrails
1010 restful_authentication
1009 haml
@briandoll
briandoll / top_gems.state_of_the_stack.txt
Created September 28, 2011 18:58
Top 50 Ruby Gems in Production : New Relic State of the Stack : Q3 2011
Count Gem
7570 rack
7444 rake
7425 rails
7424 activesupport
7421 bundler
7412 actionpack
7410 actionmailer
7409 activerecord
7397 activeresource
@briandoll
briandoll / performance.markdown
Created September 21, 2011 17:06 — forked from jcasimir/performance.markdown
Measuring Performance

Measuring Performance

Performance is often ignored in Rails development until it becomes a problem. If ignored too long, though, it can get very tricky to improve. It's valuable to regularly audit performance and look for hotspots or design choices that are slowing things down.

Inspecting the Logs

Inspecting the log will help identify the source of several performance issues the application may have.

The Rails application log outputs the time spent processing each request. It breakdowns the time spent at the database level as well processing the view code. In development mode, the logs are displayed on STDOUT where the server is being run. In a production setting the logs will be in log/production.log within the application's root directory.

@briandoll
briandoll / silly_squirrels.html
Created June 14, 2011 19:06
Silly Squirrels
<html>
<head>
<title>Silly Squirrels!</title>
<link rel="stylesheet" type="text/css" href="/theme.css" />
</head>
<body>
<h1>Silly Squirrels!</h1>
<img src="http://img.example.net/squirrel.jpg" class="silly"/>
<script src="http://tracking.example.net/tracker.js" type="text/javascript"></script>
</body>
@briandoll
briandoll / widget.js.erb
Created January 22, 2011 23:21
widget.js.erb
document.write("<div id='our-awesome-widget-target'></div>");
var receivedForm = function(data) {
$("#our-awesome-widget-target").html(data["html"]);
}
$.ajax({
url: 'http://example.com/something/<%= @some_key %>.json',
dataType: 'jsonp',
success: receivedForm
});