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
# Here is a slightly earlier version of the code with added variables for clarity (I hope) | |
def pins(str) | |
variations = str.split('').map { |c| @board[c] } | |
return variations.first if str.length <= 1 | |
position, *positions = *(-str.length..-1).to_a | |
nested_arrays = positions.inject(variations[position]) do |result, index| | |
result.product(variations[index]) | |
end | |
nested_arrays.map(&:flatten).map(&:join) | |
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
first_name,last_name,phone,van_id | |
Joleen,Tamsin,205-296-8267,1000 | |
Pen,Sabryna,206-986-8493,648017 | |
Trish,Alyssia,210-270-1802,829734 | |
Paulie,Geneva,215-424-6951,894155 |
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
// Simple javascript function print to console example | |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>Practical JavaScript</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
// Square the given number x |
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
campaign_ids = [] | |
planogram_counts = [] | |
photo_compliance_counts = [] | |
compliance_div_planograms = [] | |
ActiveRecord::Base.logger.level = 5 | |
campaigns = Campaign.where(:launched_at => 12.month.ago..Time.now) | |
# campaigns = campaigns[2..255] | |
puts "campaigns.count = #{campaigns.count}" |
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
batch_idx is increasing by batch_size. In this example 250 | |
Count in the number of locations in this case 5440 | |
Eventually batch_idx will be equal to of less then by < 250 (in_groups_of(batch_size, false)) RE: the false here | |
I have no idea how this reached 101. Empirically seems like this code would not do it. | |
num = 0 | |
count = Location.count | |
(0..count).step(250) do |index| | |
num += 1 | |
puts "#{num}) percent = #{(count > 0 ? index.to_f/count.to_f : 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
From: /Users/cmagid/projects/vmm/app/services/users/mass_upload.rb @ line 59 Users::MassUpload#process_line: | |
57: def process_line(index, header, row, allow_admins) | |
58: binding.pry | |
=> 59: row = MassUpload::Row.new({ | |
60: :index => index, | |
61: :header => header, | |
62: :row => row, | |
63: :replace_existing_values => @replace_existing_values, |
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
AspectDefinition.all.pluck | |
(:aspected_type , :column , :code , :position , :start_campaign_id).group_by{ |x| x.first } | |
=> {"Location"=> | |
[["Location" , "cid" , "store_number" , 1 , 6] , | |
["Location" , "name" , "name" , 2 , 6] , | |
["Location" , "attr001" , "finance_store_number" , 3 , 6] , | |
["Location" , "phone" , "phone" , 4 , 6] , | |
["Location" , "address1" , "address_1" , 5 , 6] , | |
["Location" , "address2" , "address_2" , 6 , 6] , | |
["Location" , "city" |
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
MESSAGE | |
undefined method `+' for nil:NilClass | |
STACK TRACE | |
warden::saml::Gatekeeper#login_url | |
lib/warden/saml/gatekeeper.rb, line 19 | |
Warden::OnedoorSaml.sso_login_url | |
config/initializers/warden/onedoor_saml.rb, line 5 |
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
cd /Users/cmagid/projects/compliance-visualization-dashboard | |
=> ok | |
brew unlink node | |
=> Error: No such keg: /Users/cmagid/brew/Cellar/node | |
brew uninstall --force node | |
=> ok | |
brew prune | |
=> ok | |
brew uninstall --ignore-dependencies python@2 | |
=> ok |
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
compliance-visualization-dashboard (FR92-47)$ type npm | |
-bash: type: npm: not found | |
compliance-visualization-dashboard (FR92-47)$ type node | |
-bash: type: node: not found | |
compliance-visualization-dashboard (FR92-47)$ type npm | |
-bash: type: npm: not found | |
compliance-visualization-dashboard (FR92-47)$ type ember | |
-bash: type: ember: not found | |
compliance-visualization-dashboard (FR92-47)$ type brew | |
brew is /Users/cmagid/brew/bin/brew |
NewerOlder