Skip to content

Instantly share code, notes, and snippets.

View courte's full-sized avatar

Courteney courte

View GitHub Profile
@courte
courte / 2019_oss_resources.md
Last active August 18, 2019 21:51
Write/Speak/Code 2019 Open Source Projects

Featured Projects

dev.to

Ruby, Rails, Javascript

GitHub | labels: wsc2019, good first issue | Website

dev.to is where programmers share ideas and help each other grow. It is an online community for sharing and discovering great ideas, having debates, and making friends.

New Sanctuary Asylum

@courte
courte / keybase.md
Created June 26, 2018 18:04
keybase.md

Keybase proof

I hereby claim:

  • I am courte on github.
  • I am courteney (https://keybase.io/courteney) on keybase.
  • I have a public key ASDfhRVfwk_cBjt4iox5vddEitCgP9Ay9Oe5tjUJTcGe7Qo

To claim this, I am signing this object:

@courte
courte / human_readable_time.rb
Created June 4, 2015 20:26
Timesheet#human_readable_billable_time
def human_readable_billable_time
billable_entries_by_rate_type = entries.select(&:billable?).group_by(&:rate_type)
human_readable_time_string = billable_entries_by_rate_type.map do |type, entries|
"#{entries.map(&:amount).sum} #{type == "weekly" ? 'days' : 'hours'}"
end.join(" + ")
human_readable_time_string.empty? ? "No billable time" : human_readable_time_string
end
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@courte
courte / example_application.js
Last active August 29, 2015 14:00
Today's recitation AJAX query example
// AJAX REQUEST
$(document).ready(function() {
// This is called after the document has loaded in its entirety
// This guarantees that any elements we bind to will exist on the page
// when we try to bind to them
// See: http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
$('form').submit( function(e) {
e.preventDefault();