Skip to content

Instantly share code, notes, and snippets.

View steveafrost's full-sized avatar
👋

Steve Frost steveafrost

👋
View GitHub Profile
@steveafrost
steveafrost / add-months-to-gform
Created August 8, 2017 22:19
Add prev, current, and next month to Gravity Form select field
var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var now = new Date(),
prev = monthNames[now.getMonth() - 1] + " " + now.getFullYear(),
current = monthNames[now.getMonth()] + " " + now.getFullYear(),
next = monthNames[now.getMonth() + 1] + " " + now.getFullYear(),
optionsField = $('.gfield_select'),
options = [prev, current, next];
// Highlight current page menu item as user scrolls
var lastId,
pageMenu = $("nav"),
pageMenuHeight = pageMenu.outerHeight(),
// All list items
menuItems = pageMenu.find("a"),
// Anchors corresponding to menu items
scrollItems = menuItems.map(function(){
var item = $($(this).attr("href"));
if (item.length) { return item; }
@steveafrost
steveafrost / config.rb
Created June 18, 2017 18:03
Middleman Inline SVG Helper
helpers do
def inline_svg name
root = Middleman::Application.root
file_path = "#{root}/source/assets/images/svg/#{name}.svg"
if File.exists?(file_path)
File.read(file_path)
else
"<span class='icon-error'>Icon #{name} not found</span>"
end
end
@steveafrost
steveafrost / token test
Created November 4, 2016 23:12
token test
yup
@steveafrost
steveafrost / great file name
Created November 4, 2016 23:10
this is a description
and some contents
@steveafrost
steveafrost / hey
Created November 4, 2016 23:08
hey
hey
@steveafrost
steveafrost / test
Created November 4, 2016 22:56
test
test
@steveafrost
steveafrost / test
Created November 4, 2016 22:55
test
test
@steveafrost
steveafrost / test
Created November 4, 2016 22:47
test
test
@steveafrost
steveafrost / test
Created November 4, 2016 22:32
test
test