- Fruit = 1-2 servings
- Animal protein = 4 - 6 servings
- Healthy fats = 5 - 9 servings
- Healthy vegetables = 6 - 11 servings
- Healthy fats = 50%
brew doctor | |
Your system is ready to brew. | |
brew: superenv removed: -L/usr/local/lib -arch x86_64 | |
Undefined symbols for architecture x86_64: | |
"_iconv", referenced from: | |
CPLRecodeIconv(char const*, char const*, char const*) in cpl_recode_iconv.o | |
CPLRecodeFromWCharIconv(wchar_t const*, char const*, char const*) in cpl_recode_iconv.o | |
"_iconv_close", referenced from: | |
CPLRecodeIconv(char const*, char const*, char const*) in cpl_recode_iconv.o |
module HomeHelper | |
def resource_name | |
:user | |
end | |
def resource | |
@resource ||= User.new | |
end | |
def devise_mapping |
def index | |
# Sleep.all for current_user | |
@sleeps = current_user.sleeps | |
# Sleep grouped and sorted in order by month | |
@sleep_months = @sleeps.group_by { |s| s.beginning_of_month }.sort { |a,b| a[0] <=> b[0] } | |
@array_for_average_sleep_months = @sleep_months.map { |month, sleep| month.strftime("%b") } | |
@array_for_hours_slept_per_month = ????? |
How would I go about mapping an array of hashes that are nested inside of an array??? I need to get an array returned for each :hours for each month, so I can then use the median method and get an average for each month. I can do it in the views, but using
<% @sleep_months.each do |month, sleep| %>
<ul><%= month.strftime("%B") %>
<% for sleeps in sleep %>
<li><%= sleeps.hours %></li>
<% end %>
</ul>
<% end %>
Create droplet of your liking (ubuntu 12.10 x32)
ssh to root in terminal with your server ip
ssh [email protected]
Add ssh fingerprint and enter password provided in email
require 'will_paginate/view_helpers/link_renderer' | |
require 'will_paginate/view_helpers/action_view' | |
module WillPaginate | |
module ActionView | |
def will_paginate(collection = nil, options = {}) | |
options[:renderer] ||= FoundationLinkRenderer | |
super.try :html_safe | |
end |
var PurdyPercent = function (num, options) { | |
this.settings = { | |
hide_decimal_on_whole : true, | |
decimals : 2, | |
truncate : false, // (soon) | |
match_decimals: true, // forces floats to match defined decimal count | |
rounding : 'default', //default, up, down (soon) | |
postfix : '%' | |
}; |
module CalendarHelper | |
def calendar(date = Date.today, &block) | |
Calendar.new(self, date, block).table | |
end | |
class Calendar < Struct.new(:view, :date, :callback) | |
HEADER = %w[SUN MON TUE WED THU FRI SAT] | |
START_DAY = :sunday | |
delegate :content_tag, to: :view |
.month { | |
font-family: 'ProximaCond'; | |
background: $primary-color; | |
font-size: 28px; | |
letter-spacing: 2px; | |
text-align: center; | |
padding: 10px 0; | |
margin-bottom: 0; | |
color: #fff; | |
a { |