Image for post
Image for post
Photo credit: Adobe Stock Photo

Binary search is a commonly used algorithm offering a more efficient form of search than a traditional linear search. Instead of iterating through an array eliminating one element at a time, you can eliminate half of the remaining elements at a time. However, it only works with sorted arrays and ordered lists.

How It Works

A binary search starts in the middle of an array and checks if that value is greater than, less than, or equal to the value you are looking for. If that element is greater, the algorithm now knows to continue searching in the left half of the array…


bcrypt is an excellent tool for shoring up password protection and user authentication in your Ruby on Rails application.

Authentication Systems

Proper user authentication and password protection are a must for any application seeking to restrict content or collect sensitive user information. With identity theft negatively impacting millions of individuals each year, data breaches could prove detrimental not only to the user but also to the platform. A single data breach has the potential to erode public trust and confidence and depending on the breach, open the door to liability. Avast recently reported that 90% of online users worry about compromised passwords…


Consider ‘Strict’ Mode

Image for post
Image for post
'use strict';

Introduced in ES5, strict mode allows for writing secure JavaScript code. With a different set of semantics versus the normal default “sloppy” mode , deployment of strict mode can significantly help in mitigating accidental programmer errors that could potentially introduce bugs into your application. This is because it restricts certain types of activities as well as generate visible errors in certain situations that would otherwise fail silently in the background without alerting the developer.

'use strict';let hasBirthdayGift = false;
const birthday = true;

if (birthday) hasBirrthdayGift = true;
if (hasBirthdayGift) console.log('I have presents! :D')
Output: Uncaught…

Brandon Fonnemann

It’s hip to b[e= mc²] → 7.819 x 10¹⁸ Joules

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store