Skip to content

Instantly share code, notes, and snippets.

View jem's full-sized avatar

Jacob Mattingley jem

View GitHub Profile
@jem
jem / moon.rb
Created November 8, 2022 04:59 — forked from nofxx/moon.rb
#
# Lunar/Moon phases ruby class
#
# Code is based upon Bradley E. Schaefer''s moon phase algorithm.
# Ruby version based on JavaScript Phase Calculator by Stephen R. Schmitt
class Moon
attr_reader :epoch, :phase, :days, :icon, :dist, :ll, :emoji
# Return the current (or input a date) moon.
# Moon.new
@jem
jem / devise.rb
Created September 22, 2011 23:48 — forked from larsthegeek/devise.rb
Devise configuration to allow username or email address for sign_in, confirmation, unlock, forgot password instructions.
################################################################
# For views/migrations etc. check http://tinyurl.com/3xfx3zm #
################################################################
# File : RAILS_APP/config/initializers/devise.rb
# Change the following only. Rest can stay same
# NOTE : You must use devise master or any version released after Mar 13, 2011 to get everything mentioned here working.
config.authentication_keys = [ :login ]
config.confirmation_keys = [ :login ]
config.unlock_keys = [ :login ]