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
def self.reindex! | |
model_name = self.name.to_s | |
total = self.count | |
indexed = 0.to_f | |
progress = 0.to_f | |
row_length = 100.to_f | |
log_level = Sunspot::Rails::LogSubscriber.logger.level | |
time_start = Time.now | |
each_second = Time.now | |
per_second = 0 |
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 'benchmark' | |
# Disable logging if in development/test mode | |
ActiveRecord::Base.logger = nil | |
model_name = Icd | |
N = 100 | |
Benchmark.bm(11) do |x| | |
x.report('ruby rand') { N.times { model_name.offset(rand(model_name.count)).first } } |
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
#!/bin/sh | |
# Homebrew Script for OSX | |
# To execute: save and `chmod +x ./brew-install-script.sh` then `./brew-install-script.sh` | |
echo "Installing brew..." | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
echo "Installing brew cask..." | |
brew tap homebrew/cask |
OlderNewer