Skip to content

Commit

Permalink
Use monkey wrench
Browse files Browse the repository at this point in the history
  • Loading branch information
parterburn committed Dec 14, 2024
1 parent 9b779d1 commit 41b11d2
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
2 changes: 2 additions & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
//= link baby.jpg
//= link psychology-of-money.jpg
//= link second-mountain.jpg
//= link anxious.jpg
//= link monkey-wrench.jpg

//= link application.css
//= link application.js
Expand Down
Binary file added app/assets/images/anxious.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/monkey-wrench.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion app/assets/stylesheets/entries.scss
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ mark {
top: 0px;
display: inline-block;
z-index: 1;
width: 331px;
background-color: rgba(252, 251, 249, 0.7);
}
.s-review-details, .s-review-details p {
Expand Down
18 changes: 9 additions & 9 deletions app/views/entries/review.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@
.s-entry-date
%h2 Total Words
%h3
- percent_book = ((@words_counter.length.to_f/96_000).to_f * 100).round
- percent_book = ((@words_counter.length.to_f/105_250).to_f * 100).round
- book_height = 500-((percent_book.to_f / 100) * 500)
%span= "#{format_number(@words_counter.length)} - #{percent_book}% of Second Mountain".html_safe
%span= "#{format_number(@words_counter.length)} - #{percent_book}% of The Monkey Wrench Gang".html_safe
.s-review-details
%div{style: 'position: relative;'}
=link_to 'https://www.amazon.com/Second-Mountain-David-Brooks/dp/0812993268/?&_encoding=UTF8&tag=thewashburnex-20&linkCode=ur2&linkId=d0631357c1e457da2fff80a1d8c51432&camp=1789&creative=9325', target: '_blank', style: "margin-top: 20px; display: block;margin-bottom: 10px;" do
.s-book-cover{style: "height: #{book_height < 0 ? 0 : book_height}px"}
= image_tag 'second-mountain.jpg', width: 324, height: 500
=link_to 'https://amzn.to/3BsRghE', target: '_blank', style: "margin-top: 20px; display: block;margin-bottom: 10px;" do
.s-book-cover{style: "width: 360px; height: #{book_height < 0 ? 0 : book_height}px"}
= image_tag 'monkey-wrench.jpg', width: 360, height: 500
.clearfix

.col-md-8.col-md-offset-2.well
Expand All @@ -103,8 +103,8 @@
%h3
- your_avg_words = @words_counter.length / @total_count
%span= format_number(your_avg_words)
- if @year.to_s == "2023"
.s-review-details
- if @year.to_s == "2024"
.s-review-details{style: "margin: 30px auto;"}
- if your_avg_words > 274
- compared = 'way more'
- elsif your_avg_words > 183
Expand All @@ -115,8 +115,8 @@
- compared = 'less'
%p= "That's #{compared} than the average of all Dabble Me users (183 words per post)."
%p
%span Collectively, all Dabble Me users could have wrote 58 books equivalent to David Brooks's,
%span<= link_to "The Second Mountain", "https://www.amazon.com/Second-Mountain-David-Brooks/dp/0812993268/?&_encoding=UTF8&tag=thewashburnex-20&linkCode=ur2&linkId=d0631357c1e457da2fff80a1d8c51432&camp=1789&creative=9325", target: :_blank
%span Collectively, all Dabble Me users could have wrote 58 books equivalent to Edward Abbey's,
%span<= link_to "The Monkey Wrench Gang", "https://amzn.to/3BsRghE", target: :_blank
%span !
.clearfix

Expand Down
10 changes: 9 additions & 1 deletion lib/tasks/entry.rake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ namespace :entry do

# TRIGGERED MANUALLY
# heroku run bundle exec rake "entry:stats[2022]" --app dabble-me --size=standard-2x
task :stats, [:year] => :environment do |_, year:|
task :stats, [:year] => :environment do |_, args|
year = args[:year]
# Ensure the year argument is provided
if year.nil?
raise ArgumentError, "Year argument is required"
end

# Stats for 2015
# 3,872 users created
# 87,572 entries created
Expand Down Expand Up @@ -123,6 +129,8 @@ namespace :entry do
# "Most Frequent Words:"
# i: 216,727



p "*"*100
p "STATS FOR #{year}"
p "*"*100
Expand Down

0 comments on commit 41b11d2

Please sign in to comment.