Skip to content

Instantly share code, notes, and snippets.

I'm trying to deploy a Rails app to Heroku. When I do I get the following error:

remote: ! Precompiling assets failed.

I am pretty sure it has something to do with the custom style.css file I have in my assets/stylesheets folder, and/or webpacker but I can't figure out how to resolve.

$ rails -v returns Rails 6.1.3.1. $ ruby -v returns ruby 2.7.0p0.

In my app/views/layouts/application.html.erb file I have the following within the <head> section.

@apgordon
apgordon / dollar_word_finder.rb
Created December 22, 2020 21:36
Input a paragraph and check if any of the individual words are dollar words.
letters = ("a".."z").to_a
numbers = (1..26).to_a
loop do
dollar_words = []
print "> "
input = gets.chomp.downcase
words = input.split(" ")
words.each do |word|
@apgordon
apgordon / dollar_word_checker.rb
Last active December 22, 2020 21:36
Input a word and check its dollar word sum
letters = ("a".."z").to_a
numbers = (1..26).to_a
loop do
print "> "
input = gets.chomp.downcase
word_sum = 0
input.split("").delete_if{|v| v.between?("a","z") == false || v == " "}.each do |letter|
@apgordon
apgordon / gist:67ea5fc966732f7df7e4baf60a18d946
Created October 5, 2018 19:11
yesterday's nhl scores and today's games
require 'httparty'
require 'chronic'
require 'pp'
@yesterday = Chronic.parse('yesterday').strftime("%Y-%m-%d")
@today = Chronic.parse('today').strftime("%Y-%m-%d")
@yesterday_schedule = JSON.parse(HTTParty.get("https://statsapi.web.nhl.com/api/v1/schedule?date=" + @yesterday).to_s)
@today_schedule = JSON.parse(HTTParty.get("https://statsapi.web.nhl.com/api/v1/schedule?date=" + @today).to_s)
def func1
puts "Creating villager... "
sleep 4
puts "Villager Created!"
end
def func2
j = 0
while j<=5
puts "simultaneous function running at the same time (stamp: #{Time.now})"
player = []
i = 0
until i == 1
print "Player? "
p = gets.chomp.capitalize
#puts "OK, #{0 - i} players left to enter."
player.push(p)
print "Players entered so far: #{player} \n \n"
i += 1
@apgordon
apgordon / gist:9766971
Created March 25, 2014 17:33
Text Hockey v2 - in progress 3/25/14
#text hockey
$players = []
$player_location = [1,2,3,1,2,2]
$location_desc = {0 => "behind own net", 1 => "in your defensive zone", 2 => "at center ice", 3 => "in the attacking zone", 4 => "behind CPU's goal"}
$possession = [0,0,0,0,0,0]
$score = [0,0]
$action = [0,4+rand(4)]
$shot_pct = [0, 0.001, 0.01, 0.25, 0.05]
def add_players
@apgordon
apgordon / gist:9309171
Created March 2, 2014 16:33
Using an array to re-/define possession (Text Hockey)
=begin
#First 4 numbers in the array represent skaters. Last 2 represent goalies.
#To see who has the puck, find the index in the array that has 1.
arr = [1,0,0,0,0,0]
puts "Player #{arr.find_index(1)} has the puck." ==> Player 0 has the puck.
#Faceoff to determine who has the puck. Either p0 through p4.
arr.map! {|x| x=0} #First reset all to 0. ==> [0,0,0,0,0,0]
@apgordon
apgordon / gist:8983518
Created February 13, 2014 20:48
Initial testing of Classes in Ruby
class Player
def initialize(name, poss, shoot_pct, pass_pct)
@name = name
@@poss = poss
@shoot_pct = shoot_pct
@pass_pct = pass_pct
end
def shoot
rand = rand(0)