This file contains 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
describe AdapterFactory do | |
describe :create do | |
context 'site-link' do | |
let(:endpoint_url) { 'http://endpoint' } | |
let(:corporate_code) { 'cc' } | |
let(:user) { 'user' } | |
let(:password) { 'pw' } | |
let(:site_link) { double } | |
let(:store_code) { 'need this for unit_type_price_list'} |
This file contains 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 Category < ActiveRecord::Base | |
has_many :posts, :dependent => :destroy | |
has_many :tags, :through => :posts, :uniq => true | |
has_one :navigation_item, :as => :navigatable | |
before_create :set_navigation_item | |
private |
This file contains 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
cd ~/Downloads | |
# Install the required JDK | |
sudo apt-get install openjdk-6-jre-headless | |
# Download, extract and move ElasticSearch | |
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.17.9.tar.gz -O elasticsearch.tar.gz | |
tar -xf elasticsearch.tar.gz | |
sudo mv elasticsearch-* elasticsearch | |
sudo mv elasticsearch /usr/local/share |
This file contains 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 punch_asshole | |
shots_away = Shot.where("cup != 0 and round_id = ? and team_id = ?", round.id, game.away.id) | |
shots_home = Shot.where("cup != 0 and round_id = ? and team_id = ?", round.id, game.home.id) | |
if shots_away.count == 2 | |
Player.includes(:shots).where("shots.cup == 0 and shots.round_id = ? and shots.team_id = ?", round.id, game.away.id).assholes += 1 | |
end | |
if shots_home.count == 2 | |
Player.includes(:shots).where("shots.cup == 0 and shots.round_id = ? and shots.team_id = ?", round.id, game.home.id).assholes += 1 | |
end |
This file contains 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
(function($) { | |
$.fn.clippy = function(text, bgcolor) { | |
console.log("in clippy. I hope to copy this " + text + " after... "); | |
console.log($(this)); | |
var swf = "/jquery-plugins/clippy-0.0.1/clippy.swf" | |
if (!bgcolor) { | |
var node = $(this); | |
while (node.css('background-color') == 'transparent' && node.length) { | |
node = node.parent(); | |
} |