Skip to content

Instantly share code, notes, and snippets.

View mghaught's full-sized avatar

Marty Haught mghaught

View GitHub Profile
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title></title>
</head>
<body>
<table class="table" id="todo_list">
<tbody>
<tr>
<th>
# in ApplicationController
def admin_nav
return unless current_user
@sec_nav = []
@current_main = "Admin"
@sec_nav << {:name => "Users", :link => users_path} if admin?
@sec_nav << {:name => "Invites", :link => invites_path} if admin?
end
def dates_this_year
first_day = @ctl_config.smc_connection.select_value("select min(created_at) from coupons")
first_day = first_day.nil? ? Date.today : Date.parse(first_day)
first_day = Date.new(first_day.year.to_i)
last_day = Date.new(Date.today.year + 1) - 1
dates = []
first_day.upto(last_day) do |day|
dates << {
:day_of_year => day.yday,