Skip to content

Instantly share code, notes, and snippets.

View courtneyphillips's full-sized avatar

Courtney Phillips courtneyphillips

  • Datadog
  • Portland, Oregon
View GitHub Profile
@courtneyphillips
courtneyphillips / Code Review
Last active February 18, 2016 16:20
Sample code provided for Epicodus Level 2 JavaScript Modern JS Apps Code Review
// index.html
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script type="text/javascript" src="js/git-interface.js"></script>
<title>Githupdates</title>
</head>
<body>
</body>
@courtneyphillips
courtneyphillips / Gemfile
Last active March 15, 2016 17:21
Bootstrap popovers in Rails
gem 'bootstrap-tooltip-rails'
//ADDITIONAL OPTIONS & DOCUMENTATION
http://getbootstrap.com/javascript/#popovers
@courtneyphillips
courtneyphillips / controller.rb
Last active March 15, 2016 17:17
Live-sorting via link in Rails.
def index
@reviews = Review.order(params[:sort])
end
@courtneyphillips
courtneyphillips / controller.rb
Last active March 15, 2016 17:19
Example controller, view, schema and routes for including upvote/downvote functionality in Ruby on Rails.
def upvote
@item = Item.find(params[:id])
@item.upvotes += 1
@item.save
redirect_to items_path
end