Category: Uncategorized

RSpec Ruby Testing: Shared Examples and Shared Context

Basic Rspec testing is extremely intuitive, but it’s very easy for code to get repetitive and start violating the DRY principle. Very often we can find ourselves copy and pasting example after example and subject after subject. Luckily, RSpec gives us the ability to DRY up our code by...
Read More

Heap Sort in Ruby

Following up on my quicksort and merge sort blog posts, I’m now going dive into the heap sort. I found the heap sort to be a tad more obtuse than the other basic sorts, and I think the main reason is we’re moving on from just using arrays and...
Read More

Quicksort in Ruby

In a previous blog post, I went over how to implement a merge sort in Ruby. We’re just going to keep the merge train rolling. Next stop: Quicksort! Like merge sort, quicksort is recursive and uses divide & conquer. Its worst case run time is O(n^2), which is on...
Read More

Merge Sort in Ruby

Sorting is a basic and extremely key component of algorithm study. Many other/higher algorithms rely on sorted lists to work better, so placing things in the correct order creates the foundation for a lot of problem-solving. We’re going to skip over the more direct insertion and selection sorts to...
Read More

Implementing Stripe in a React app with a Rails API Backend

I know why you’re here. You’re working on a React app for your portfolio or bootcamp project, and want to add some form of payment processing to impress people. But the PayPal API looks daunting. Luckily, Stripe is very intuitive and implementing a basic credit card payment framework is...
Read More