Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mark-kraemer on github.
  • I am kram (https://keybase.io/kram) on keybase.
  • I have a public key ASCyFIUGJBv3y5TnYMViPArrg8GYNan2S45YKta24b1rYAo

To claim this, I am signing this object:

@mark-kraemer
mark-kraemer / timezone_issue.rb
Last active May 24, 2016 21:52
An issue with rails timezones
# I have a time column named meeting_time
# When the time is displayed in the views, it is in the CST timezone
# But in the controller, the timezone is CDT
# In the application_controller there is a before_action to set the timezone on each request
def set_timezone
Time.zone = current_user.try(:timezone) || "Central Time (US & Canada)"
end
# In the form.html.haml
@mark-kraemer
mark-kraemer / nil-not-included.rb
Created June 1, 2015 17:07
When doing a where.not(), columns with nil are excluded
# When get all the orders
Order.select(:id, :status)
#=>
#<Order id: 1, status: "complete">
#<Order id: 2, status: "complete">
#<Order id: 3, status: "processing">
#<Order id: 4, status: nil>
# When I run the following query:
@mark-kraemer
mark-kraemer / gist:16f9fae6f60bf4ba1041
Last active August 29, 2015 14:07
Font assets missing fingerprint on production.

Background

I'm using:

  • rails 4.1.6
  • sass-rails 4.0.3

On production, my custom fonts are not using the fingerprinted version which is causing 404 errors. The fingerprinted versions do exist on the server, but application.css is not referencing them. Instead it is referencing /assets/raleway-ln/some-font as seen below.