Add LOC flavor text

This commit is contained in:
Max Wofford 2025-06-10 16:50:45 -04:00
parent 6fb4f78fea
commit 5ac8b76ccd
2 changed files with 5 additions and 0 deletions

View file

@ -0,0 +1,4 @@
# Application metrics calculated at startup
lines_of_code = `find . -name "*.rb" -not -path "./vendor/*" -not -path "./tmp/*" -exec wc -l {} + | tail -1 | awk '{print $1}'`.strip.to_i rescue 0
Rails.application.config.lines_of_code = lines_of_code

View file

@ -215,6 +215,7 @@ class FlavorText
"a minute saved is a minute earned",
"how did it get so late so soon?", # dr. seuss
"You can have it all. Just not all at once.", # oprah i think?
"written in #{Rails.application.config.lines_of_code} lines of code!",
"#{%w[est created inited].sample} <span id='init-time-ago'>#{Time.now.to_i - Time.parse("Sun Feb 16 03:21:30 2025 -0500").to_i}</span> seconds ago!<script>setInterval(()=>{document.getElementById('init-time-ago').innerHTML=parseInt(document.getElementById('init-time-ago').innerHTML)+1},1000)</script>".html_safe,
"uptime: <span id='uptime'>#{Time.now.to_i - Rails.application.config.server_start_time.to_i}</span> seconds!<script>setInterval(()=>{document.getElementById('uptime').innerHTML=parseInt(document.getElementById('uptime').innerHTML)+1},1000)</script>".html_safe,
"It takes a long time to build something good: <a href='https://github.com/hackclub/hackatime#readme' target='_blank'><img src='https://hackatime-badge.hackclub.com/U0C7B14Q3/harbor'></a>".html_safe,