Skip to content

Instantly share code, notes, and snippets.

View jtperreault's full-sized avatar

James T. Perreault jtperreault

  • Traverse City, MI
View GitHub Profile
@jtperreault
jtperreault / phones_controller.rb
Created May 15, 2017 01:37
example phone controller
class PhonesController < ApplicationController
def index
@phones = Phone.all
end
end
<h1>All the Phones I know about!</h1>
<div id="every-phone">
<% @phones.each do |fone| %>
<h5><%= fone.name %></h5>
<% end %>
</div>
@jtperreault
jtperreault / application.html.erb
Last active October 3, 2017 15:17
Preventing layout on root_url?
<%= render 'layouts/header' unless current_page?(root_url) %>
Results of ping while running speedtest at http://www.dslreports.com/speedtest
PING google.com (173.194.192.102): 56 data bytes
64 bytes from 173.194.192.102: icmp_seq=0 ttl=42 time=41.444 ms
64 bytes from 173.194.192.102: icmp_seq=1 ttl=42 time=41.425 ms
64 bytes from 173.194.192.102: icmp_seq=2 ttl=42 time=41.300 ms
64 bytes from 173.194.192.102: icmp_seq=3 ttl=42 time=42.305 ms
64 bytes from 173.194.192.102: icmp_seq=4 ttl=42 time=44.678 ms
64 bytes from 173.194.192.102: icmp_seq=5 ttl=42 time=44.088 ms
64 bytes from 173.194.192.102: icmp_seq=6 ttl=42 time=48.350 ms
@jtperreault
jtperreault / code.rb
Last active March 18, 2019 23:09 — forked from ben-tvpp/code.rb
class WalkSectionController < ApplicationController
def go_for
@walk_section = WalkSection.find(params[:id])
@walk = @walk_section.walk
# full_url = request.base_url + request.path
# i = full_url.rindex( '/' )
@base_url = request.base_url
@walk_section_buttons = @walk_section.walk_section_buttons
end
message = "You have been granted to #{pluralize(industry_names.count, "industry")}: #{industry_list.join(', ')}"
@user.send_to_slack(message)