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
@http://www.pivotaltracker.com/story/show/9610041 | |
Feature: agent orders theft guard bond | |
As an agent I should be able to order a theft guard bond | |
with only valid rider combinations | |
Background: | |
Given the fidelity bond templates | |
Given I'm an authenticated agent belonging to an agency | |
When I go to the Theft Guard products page | |
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
module Enumerable | |
def to_histogram | |
result = Hash.new(0) | |
each { |x| result[x] += 1 } | |
result | |
end | |
def most_popular | |
h = self.to_histogram | |
max_by { |x| h[x] } |
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
env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config |
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
# UPDATED May 16 2012 for ImageRight v5 | |
# How to generate a set of diary items for agencies | |
# Use rails console, paste list of agency ids into %w below | |
# Adjust other parameters as appropriate | |
# IMPORTANT: left pad with zeros to make agency ids 5 digits | |
agency_ids = %w( ).map{|a| a.to_s.rjust(5, '0')}.uniq.sort | |
diary_items = [] |
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
CLOSED LOGIC: | |
longExpDate := | |
@Middle(@Text(BDEXP);4;2) + "/" + | |
@Middle(@Text(BDEXP);6;2) + "/" + | |
@Left(@Text(BDEXP);4); | |
declinedOrCompletedStatReport := @If(progressStatus = "Closed" : "Completed" : "Declined";1;0); | |
cond1 := @TextToNumber(@Text(BDBAMT)) < 100000 & !BDDEL = "" : "P" & @Right(BIIC;1) = "Y"; |
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
# courtesy of http://codepad.org/tBON208e | |
$_ = "1,2,3,8,9,12,15,17,18,19,20,21,22,23"; | |
s/(?<!\d)(\d+)(?:,((??{$++1})))+(?!\d)/$1-$+/g; | |
print; |
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
# Date and Time symbol meanings: | |
%a - The abbreviated weekday name (``Sun'') | |
%A - The full weekday name (``Sunday'') | |
%b - The abbreviated month name (``Jan'') | |
%B - The full month name (``January'') | |
%c - The preferred local date and time representation | |
%d - Day of the month (01..31) | |
%H - Hour of the day, 24-hour clock (00..23) | |
%I - Hour of the day, 12-hour clock (01..12) |
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
Bundler command complained of not being able to find bundle1.o although I could easily locate it within /usr/lib myself. | |
Damn computers. | |
gem install rdiscount -- --with-ldflags="-L/usr/lib" |
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
#!/usr/bin/ruby | |
ioreg_data = IO.popen("ioreg -w0 -l").readlines().join | |
ioreg_data.sub!(/.*(\+\-o AppleSmartBattery.*?\+\-o).*/m, '\\1') | |
ioreg_data.gsub!(/\s+\|/, "") | |
ioreg_data.gsub!(/\s\s+/, "\n") | |
battery = Hash.new | |
ioreg_data.split(/\n+/).each do |line| | |
key, value = line.split(' = ')[0..1] | |
next if key.nil? || value.nil? |
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
Contract Bond Factory | |
FactoryGirl.build(:contract_bond) | |
--> Principal | |
--> Appointed Agency | |
--> contract_underwriter | |
--> User | |
--> Domino User | |
--> Assistant |
OlderNewer