This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+--------------------------------------------------------+ | |
| Name | Time (ms) | Requests/s | IO (KB/s) | Errors | | |
+--------------------------------------------------------+ | |
| baseline | 1310.3 | 0.8 | 3.9 | 14 | | |
+--------------------------------------------------------+ | |
+-----------------------------------------------------------------------------------------------------------------------------------------------+ | |
| % Baseline | Name | Time (ms) | Requests/s | IO (KB/s) | Errors | | |
+-----------------------------------------------------------------------------------------------------------------------------------------------+ | |
| 1.11929 | Using named scopes for late recommendations | 1466.6 | 0.7 | 3.5 | 14 | | |
| 1.17813 | Actually implementing named scopes for late recommendations into controller | 1543.7 | 0.6 | 3.8 | 14 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
def site_name | |
@@site_name ||= MyConfig['site_name'] | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In this model, we'll use a Markov chain to calculate probabilities associated with "Tweeting" | |
# A few code helpers for our exercise | |
class Float | |
def to_percentage | |
self*100 | |
end | |
end | |
# Now let's define our states |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Part of the Dallas Ruby "A Year in Code" December 2010 meeting. | |
# http://groups.google.com/group/dallasrb/browse_thread/thread/1c114671b17dd81f | |
# Shame | |
# Yes it was committed. | |
# Yes I did come up with something better before it went to production. :) | |
<% 60.times do %> <% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test/unit' | |
class PhoneNumberizeTest < Test::Unit::TestCase | |
# MM2: The one liner....and the one called by the tests | |
# yes it's ugly...I would probably not like to pick up someone else's code and see this ;) | |
def phone_numberize(number) | |
number.gsub(/#{/(\d{#{number.length-10}})/ if number.length>10}(\d{3})(\d{3})?(\d{1,4})/,"\\1-\\2-\\3-\\4").gsub("--","-").chomp("-") | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'uri' | |
class LongUrl | |
attr_accessor :short_url | |
attr_reader :long_url | |
def initialize(short_url) | |
@short_url = short_url |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Fluidinfo | |
class SetOfStrings < Array; end | |
SERIALIZABLE_TYPES << SetOfStrings | |
end | |
# Use: strings = Fluidinfo::SetOfStrings["a", "b", "c"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Part of the Dallas Ruby "Best and Worst of 2011" showcase at the December 2011 meeting | |
# http://groups.google.com/group/dallasrb/browse_thread/thread/998dd95dd4677042 | |
# Shame | |
@followings = current_profile.watch_events # NO LIMIT | |
# Fav | |
# Recursive Module Includes - yaml_dot_notation.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Rubyist | |
def check_me | |
puts "Rubyist" | |
end | |
end | |
class Chef | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In response to: | |
Josh Susser - The @rubyrogues topic for tomorrow is Versioning and Release Process. Any questions or particular things you'd like to see us address? | |
Mark McSpadden - @joshsusser @rubyrogues The versioning/release dance between self maintained services and gems. (When you own the service and the gem.) | |
Josh Susser - @markmcspadden can you expand on that? I don't quite understand what you're asking. @rubyrogues | |
-- | |
I've experienced several situations where there's an internal service | |
(usually Rails, sometimes Sinatra or Rack) that has a corresponding gem. |
OlderNewer